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