-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
34 lines (29 loc) · 982 Bytes
/
Dockerfile
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
FROM node:16-alpine3.15
RUN apk update
RUN apk add nginx
RUN apk add jq
RUN apk add yq
# Permissions needed to run nginx as a non root user
RUN chown -R node:node /usr/share/nginx
RUN chown -R node:node /var/lib/nginx
RUN chmod 777 /var/log/nginx
RUN chmod 777 /run/nginx
RUN chown -R node:node /run/nginx
USER node
WORKDIR /home/node
COPY --chown=node:node ./package.json /home/node
# COPY ./yarn.lock /home/node
ARG REACT_APP_DJSCIVIZ_BACKEND_PREFIX=/api
RUN yarn install
COPY --chown=node:node ./tsconfig.json /home/node
COPY --chown=node:node ./src /home/node/src
COPY --chown=node:node ./public /home/node/public
COPY --chown=node:node ./default.conf /etc/nginx/http.d/
COPY --chown=node:node ./default.conf /etc/nginx/conf.d/
COPY --chown=node:node ./sci-viz-hotreload-dev.sh .
COPY --chown=node:node ./sci-viz-hotreload-prod.sh .
ENV NODE_OPTIONS --max-old-space-size=6000
ARG PUBLIC_URL=./
RUN yarn build
RUN chmod -R 777 ./build
CMD ["nginx", "-g", "daemon off;"]