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