Dockerfile 523 B

1234567891011121314151617181920
  1. FROM node:14.0.0 as builder
  2. WORKDIR /app/tmr-group-admin
  3. ENV HOSTIP = 'http://192.168.1.70:8081/'
  4. #拷贝源码
  5. COPY . .
  6. # RUN sed -i "s/SERVER_URL/$hostip/g" ./src/utils/configs.js
  7. #安装依赖
  8. RUN npm install --registry=https://registry.npm.taobao.org
  9. # 开始构建
  10. RUN npm run build:prod
  11. # 第二阶段构建
  12. FROM nginx:alpine
  13. COPY --from=builder /app/tmr-group-admin/dist/ /usr/share/nginx/html/
  14. COPY --from=builder /app/tmr-group-admin/default.conf.template /etc/nginx/templates/default.conf.template
  15. EXPOSE 80