forked from nhattruongniit/react-boilerplate-material
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (26 loc) · 745 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
# stage0
FROM node:14.15.1-alpine AS build-stage
USER root
RUN npm -g install serve
RUN rm -rf /home/node/app
RUN mkdir /home/node/app
WORKDIR /home/node/app
COPY . /home/node/app
RUN cd /home/node/app
RUN npm install
RUN npm run build
RUN chown -R root:root /home/node/app/build
RUN ls -la /home/node/app/build
# stage1
FROM nginx:alpine AS RUN-stage
USER root
## Remove default nginx index page
RUN rm -rf /usr/share/nginx/html
# Copy from the stage 1
COPY --from=build-stage /home/node/app/build /usr/share/nginx/html
COPY --from=build-stage` /home/node/app/.nginx/nginx.conf /etc/nginx/conf.d/default.conf
# COPY nginx/nginx.conf /etc/nginx/conf.d
EXPOSE 80
ENTRYPOINT ["nginx", "-g", "daemon off;"]
# start app
# CMD ["npm", "start"]