Files
react-template-esbuild/deploy/production/Dockerfile
2025-09-18 19:02:11 +03:00

22 lines
440 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### STAGE 1: Build ###
# We label our stage as builder
FROM node:16 as builder
WORKDIR /app
COPY . .
RUN yarn install
RUN yarn build:live
# runner container
# - nginx, to serve static built React app
# nginx state for serving content
FROM nginx:stable-alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY deploy/production/nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]