-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.label-client
54 lines (39 loc) · 1.49 KB
/
Dockerfile.label-client
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Step 1 : build label frontend
FROM node:16-alpine as builder
ARG http_proxy
ARG https_proxy
# Use proxy
RUN yarn config set proxy $http_proxy; \
yarn config set https-proxy $https_proxy;
WORKDIR /home/node/
# install git for pelta-design-system package
RUN apk add git
# Copy context files
COPY ./package.json ./
COPY packages/generic/core/package.json ./packages/generic/core/
COPY packages/generic/backend/package.json ./packages/generic/backend/
COPY . .
# Do not bring backend dependencies to frontend prod
# Workaround to rewrite 'workspaces' in packages.json file to not run 'yarn install' in all packages
RUN sed -e 's|"packages/generic/\*"|"packages/generic/core"|' \
-e 's|"packages/courDeCassation/"|"packages/generic/client"|' \
package.json > package.json.new && \
mv package.json.new package.json
# Install dependencies
RUN yarn install --production
# Compile project without lerna
RUN cd /home/node/packages/generic/core && yarn compile && \
cd /home/node/packages/generic/client && yarn build
# Setup nginx server to serve app
FROM nginx:1.23.0-alpine as label-client
# is this usefull ?
RUN for dir in client proxy fastcgi uwsgi scgi;do\
mkdir /var/cache/nginx/${dir}_temp;\
done
WORKDIR /home/nginx
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/gzip.conf /etc/nginx/gzip.conf
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /home/node/packages/generic/client/build /usr/share/nginx/html/label/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]