-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
33 lines (25 loc) · 1.09 KB
/
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
FROM node:16.13.0-buster as builder
RUN set -x; apt update -y; apt install -y git;
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app
COPY package*.json ./
RUN npm install --loglevel verbose
COPY --chown=node:node .git .git
COPY --chown=node:node tsconfig.json tsconfig.json
COPY --chown=node:node .babelrc .babelrc
COPY --chown=node:node .eslintrc.js .eslintrc.js
COPY --chown=node:node .prettierignore .prettierignore
COPY --chown=node:node .prettierrc .prettierrc
COPY --chown=node:node imgs imgs
COPY --chown=node:node src src
COPY --chown=node:node webpack.config.babel.js webpack.config.babel.js
ENV NODE_ENV release
USER node
RUN set -ex;\
mkdir -p -v build; \
pwd; ls -la; \
npm run build;
RUN rm --recursive --verbose .git
FROM nginx:1.18-alpine
COPY --chown=nginx:nginx --from=builder /home/node/app/build /usr/share/nginx/html/
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf