Dockerfile 452 B

12345678910111213141516
  1. FROM node:14.0.0 as builder
  2. WORKDIR /app/tmr-group-admin
  3. #拷贝源码
  4. COPY . .
  5. #安装依赖
  6. RUN npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass
  7. RUN npm install
  8. # 开始构建
  9. RUN npm run build:prod
  10. # 第二阶段构建
  11. FROM nginx:alpine
  12. COPY --from=builder /app/tmr-group-admin/dist/ /usr/share/nginx/html/
  13. COPY --from=builder /app/tmr-group-admin/default.conf.template /etc/nginx/templates/default.conf.template
  14. EXPOSE 80