From cf22b8cfe5b5d77da83094d8145adfcb871be876 Mon Sep 17 00:00:00 2001 From: lewis_yan Date: Wed, 1 Apr 2026 10:51:25 +0800 Subject: [PATCH] chore: use pnpm instead of yarn in web Dockerfile --- web/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index 788847a..19e5755 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -3,17 +3,20 @@ FROM node:20-alpine as builder WORKDIR /web -# 先复制 package.json 和 yarn.lock -COPY package.json yarn.lock* ./ +# 安装 pnpm +RUN npm install -g pnpm --registry=https://registry.npmmirror.com + +# 先复制 package.json 和 pnpm-lock.yaml +COPY package.json pnpm-lock.yaml* ./ # 安装依赖(利用缓存) -RUN yarn install --registry=https://registry.npmmirror.com +RUN pnpm install --registry=https://registry.npmmirror.com --frozen-lockfile # 复制源代码 COPY . . # 构建 -RUN yarn build +RUN pnpm build # 第二阶段:Nginx 运行时 FROM docker.1ms.run/nginx:alpine