From 437eb3b4b287bb26cee9625b17ff0cbe3f95e2e7 Mon Sep 17 00:00:00 2001 From: wangjun Date: Fri, 15 Sep 2023 21:19:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../abp-vnext-pro-nuget-all/vben28/Dockerfile | 21 +++++++++++++------ .../vben28/Dockerfile | 21 +++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/templates/abp-vnext-pro-nuget-all/vben28/Dockerfile b/templates/abp-vnext-pro-nuget-all/vben28/Dockerfile index f1c1a6d8..506081a8 100644 --- a/templates/abp-vnext-pro-nuget-all/vben28/Dockerfile +++ b/templates/abp-vnext-pro-nuget-all/vben28/Dockerfile @@ -1,9 +1,18 @@ -FROM nginx:1.17.3-alpine as base -EXPOSE 80 +FROM node:16-alpine as build-stage +WORKDIR /app +COPY . ./ +ENV NODE_OPTIONS=--max-old-space-size=16384 +RUN npm install pnpm -g +RUN pnpm i +RUN pnpm build + -COPY /_nginx/nginx.conf /etc/nginx/nginx.conf -COPY /_nginx/env.js /etc/nginx/env.js -COPY /_nginx/default.conf /etc/nginx/conf.d/default.conf -COPY /dist/ /usr/share/nginx/html +FROM nginx:1.17.3-alpine as production-stage +COPY --from=build-stage app/_nginx/nginx.conf /etc/nginx/nginx.conf +COPY --from=build-stage app/_nginx/env.js /etc/nginx/env.js +COPY --from=build-stage app/_nginx/default.conf /etc/nginx/conf.d/default.conf +COPY --from=build-stage app/dist/ /usr/share/nginx/html +EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] + diff --git a/templates/abp-vnext-pro-nuget-simplify/vben28/Dockerfile b/templates/abp-vnext-pro-nuget-simplify/vben28/Dockerfile index f1c1a6d8..506081a8 100644 --- a/templates/abp-vnext-pro-nuget-simplify/vben28/Dockerfile +++ b/templates/abp-vnext-pro-nuget-simplify/vben28/Dockerfile @@ -1,9 +1,18 @@ -FROM nginx:1.17.3-alpine as base -EXPOSE 80 +FROM node:16-alpine as build-stage +WORKDIR /app +COPY . ./ +ENV NODE_OPTIONS=--max-old-space-size=16384 +RUN npm install pnpm -g +RUN pnpm i +RUN pnpm build + -COPY /_nginx/nginx.conf /etc/nginx/nginx.conf -COPY /_nginx/env.js /etc/nginx/env.js -COPY /_nginx/default.conf /etc/nginx/conf.d/default.conf -COPY /dist/ /usr/share/nginx/html +FROM nginx:1.17.3-alpine as production-stage +COPY --from=build-stage app/_nginx/nginx.conf /etc/nginx/nginx.conf +COPY --from=build-stage app/_nginx/env.js /etc/nginx/env.js +COPY --from=build-stage app/_nginx/default.conf /etc/nginx/conf.d/default.conf +COPY --from=build-stage app/dist/ /usr/share/nginx/html +EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] +