From bbb4ad6bd5f38f9e82d3e128bdd56c4abc38a323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=BA=AD?= Date: Tue, 19 Aug 2025 10:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20ci/cd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7e4c14..f535562 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,15 @@ -FROM nexus.zzwb.cc:18444/nginx:1.21-alpine -COPY dist /usr/share/nginx/html +# 构建阶段 +FROM registry.cn-shenzhen.aliyuncs.com/zuoge-proxy/node:20-alpine AS build +RUN npm install -g pnpm --registry=https://registry.npmmirror.com + +WORKDIR /app +COPY package.json pnpm-lock.yaml* ./ +RUN pnpm install --registry=https://registry.npmmirror.com + +COPY . . +RUN pnpm build + +# 部署阶段 +FROM registry.cn-shenzhen.aliyuncs.com/zuoge-proxy/nginx:1.27.3-alpine AS app +COPY --from=build /app/dist /usr/share/nginx/html COPY docker/nginx.conf /etc/nginx/nginx.conf