Dockerfile.txprod 550 B

123456789101112131415161718192021222324
  1. FROM node:16-buster as build
  2. WORKDIR /workspace
  3. COPY package.json .
  4. RUN npm install --force --registry=https://registry.npm.taobao.org
  5. ADD . /workspace
  6. RUN npm run build:txprod
  7. FROM nginx:mainline
  8. WORKDIR /usr/share/nginx/html
  9. COPY --from=build /workspace/build /usr/share/nginx/html/dag
  10. RUN echo "\
  11. server {\n\
  12. listen 80;\n\
  13. listen [::]:80;\n\
  14. \n\
  15. root /usr/share/nginx/html/dag;\n\
  16. index index.html index.htm;\n\
  17. \n\
  18. location / {\n\
  19. try_files \$uri \$uri/ /index.html;\n\
  20. }\n\
  21. }\n\
  22. " > /etc/nginx/conf.d/default.conf