Dockerfile 556 B

1234567891011121314151617181920
  1. FROM node:18 AS build-stage
  2. ENV TZ Asia/Shanghai
  3. MAINTAINER wangliang@qmth.com.cn
  4. WORKDIR /opt
  5. COPY . .
  6. RUN npm config set registry http://registry.cnpmjs.org && npm config set registry http://registry.npm.taobao.org
  7. RUN npm install
  8. RUN NODE_OPTIONS=--max_old_space_size=4096 npm run build
  9. FROM nginx:1.27.4 AS production-stage
  10. ENV TZ Asia/Shanghai
  11. MAINTAINER wangliang@qmth.com.cn
  12. WORKDIR /opt
  13. RUN rm /etc/nginx/conf.d/default.conf
  14. COPY --from=build-stage /opt/dist /opt/dist
  15. COPY ./app.conf /etc/nginx/conf.d/app.conf
  16. CMD ["nginx","-g","daemon off;"]