1
0

Dockerfile 620 B

123456789101112131415161718192021222324252627282930
  1. FROM node:20-slim AS builder
  2. # --max-old-space-size
  3. ENV PNPM_HOME="/pnpm"
  4. ENV PATH="$PNPM_HOME:$PATH"
  5. ENV NODE_OPTIONS=--max-old-space-size=8192
  6. ENV TZ=Asia/Shanghai
  7. RUN corepack enable
  8. WORKDIR /app
  9. # copy package.json and pnpm-lock.yaml to workspace
  10. COPY . /app
  11. RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
  12. RUN pnpm run build
  13. RUN echo "Builder Success 🎉"
  14. FROM nginx:stable-alpine as production
  15. COPY --from=builder /app/apps/antd-view/dist /usr/share/nginx/html
  16. COPY ./deploy/nginx.conf /etc/nginx/nginx.conf
  17. EXPOSE 8080
  18. # start nginx
  19. CMD ["nginx", "-g", "daemon off;"]