Dockerfile 550 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. RUN npm cache clean --force
  8. #安装依赖
  9. RUN npm install --registry=https://registry.npm.taobao.org
  10. # 开始构建
  11. RUN npm run build:prod
  12. # 第二阶段构建
  13. FROM nginx:alpine
  14. COPY --from=builder /app/tmr-group-admin/dist/ /usr/share/nginx/html/
  15. COPY --from=builder /app/tmr-group-admin/default.conf.template /etc/nginx/templates/default.conf.template
  16. EXPOSE 80