Dockerfile 450 B

123456789101112131415161718
  1. FROM node:latest as builder
  2. WORKDIR /app/kpt-system-web
  3. #拷贝源码
  4. COPY . .
  5. #安装依赖
  6. RUN npm config set registry https://registry.npmmirror.com/
  7. RUN npm install -g pnpm
  8. RUN pnpm install
  9. # 开始构建
  10. RUN pnpm run build
  11. # 第二阶段构建
  12. FROM nginx:alpine as prod
  13. COPY --from=builder /app/kpt-system-web/dist/ /usr/share/nginx/html/
  14. COPY --from=builder /app/kpt-system-web/default.conf.template /etc/nginx/conf.d/default.conf
  15. EXPOSE 80