File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11# Stage 1: build the application
2- FROM nginx:alpine AS build
2+ FROM nginx:alpine AS build-nginx
3+ RUN apk add nodejs npm
4+ COPY . .
5+ RUN npm i
6+ RUN npm run build
37RUN rm -rf /etc/nginx/conf.d/*
48COPY nginx.conf /etc/nginx/
5- RUN npm image
6- RUN npm run build
79COPY public /usr/share/nginx/html/
810EXPOSE 80
911
1012# Stage 2: final image
1113FROM alpine:latest
1214RUN apk add --no-cache nginx && mkdir -p /run/nginx
13- COPY --from=build /usr/share/nginx/html/ /usr/share/nginx/html/
14- COPY --from=build /etc/nginx/nginx.conf /etc/nginx/nginx.conf
15+ COPY --from=build-nginx /usr/share/nginx/html/ /usr/share/nginx/html/
16+ COPY --from=build-nginx /etc/nginx/nginx.conf /etc/nginx/nginx.conf
1517EXPOSE 80
1618HEALTHCHECK --interval=1s --timeout=3s CMD wget -q -O - http://localhost:80 || exit 1
1719CMD ["nginx" , "-g" , "daemon off;" ]
You can’t perform that action at this time.
0 commit comments