Dockerfile 567 B

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