Dockerfile 468 B

123456789101112131415161718192021222324
  1. # ---- Build Stage ----
  2. FROM node:20-alpine AS builder
  3. RUN corepack enable && corepack prepare pnpm@latest --activate
  4. WORKDIR /app
  5. COPY package.json pnpm-lock.yaml ./
  6. RUN pnpm install --frozen-lockfile
  7. COPY . .
  8. ARG BUILD_MODE=production
  9. RUN pnpm build:${BUILD_MODE}
  10. # ---- Serve Stage ----
  11. FROM nginx:stable-alpine
  12. COPY nginx.conf /etc/nginx/conf.d/default.conf
  13. COPY --from=builder /app/dist /usr/share/nginx/html
  14. EXPOSE 80
  15. CMD ["nginx", "-g", "daemon off;"]