From ba3727723e4129ae845aa56b059c697f6a204e13 Mon Sep 17 00:00:00 2001 From: xiangning Date: Fri, 17 Jul 2026 13:29:23 +0800 Subject: [PATCH] =?UTF-8?q?perf(docker):=20=E8=B0=83=E5=A4=A7=20pnpm=20fet?= =?UTF-8?q?ch=20=E8=B6=85=E6=97=B6=E4=B8=8E=E9=87=8D=E8=AF=95=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=20install=20=E4=B8=AD=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 85edf31..e12f06c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,11 @@ WORKDIR /app RUN npm install -g pnpm@11.9.0 # npm 包源走阿里 npmmirror(国内最稳,避免 registry.npmjs.org 拉取不稳) -RUN pnpm config set registry https://registry.npmmirror.com +# 调大 fetch 超时与重试,防止 install 中断 +RUN pnpm config set registry https://registry.npmmirror.com \ + && pnpm config set fetch-timeout 600000 \ + && pnpm config set fetch-retries 5 \ + && pnpm config set fetch-retry-mintimeout 10000 # 先拷贝依赖清单,利用 Docker 层缓存 COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./