Dockerfile_production 483 B

1234567891011121314151617181920212223242526272829
  1. # Base image
  2. FROM node:18
  3. # Set the working directory in the container
  4. WORKDIR /app
  5. # copy src
  6. COPY .. .
  7. # install pnpm
  8. RUN npm install -g pnpm
  9. # install initial depenancies
  10. RUN pnpm install
  11. # install production depencancies
  12. RUN pnpm install --production
  13. # build
  14. RUN node build
  15. #pull nginx as webser and load balancer
  16. FROM nginx:stable-alpine3.20-slim
  17. RUN apk update && apk upgrade --no-cache
  18. # copy the build files to nginx entry point
  19. COPY ./public /usr/share/nginx/html