123456789101112131415161718192021 |
- FROM node:18 AS build-stage
- ENV TZ Asia/Shanghai
- MAINTAINER wangliang@qmth.com.cn
- WORKDIR /app
- COPY . .
- RUN npm config set registry http://registry.cnpmjs.org && npm config set registry http://registry.npm.taobao.org
- RUN npm install
- RUN NODE_OPTIONS=--max_old_space_size=4096 npm run build
- FROM nginx:1.17.3 AS production-stage
- ENV TZ Asia/Shanghai
- MAINTAINER wangliang@qmth.com.cn
- WORKDIR /opt
- ARG CONF_NAME
- #RUN rm /etc/nginx/conf.d/default.conf
- COPY --from=build-stage /app/dist /opt/dist
- COPY ./$CONF_NAME /etc/nginx/conf.d/$CONF_NAME
- CMD ["nginx","-g","daemon off;"]
|