Dockerfile 614 B

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