perf(docker): 调大 pnpm fetch 超时与重试,防 install 中断

This commit is contained in:
xiangning 2026-07-17 13:29:23 +08:00
parent 79742d25f8
commit ba3727723e

View File

@ -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 ./