From 3d85268c90299214d46531c3e075afe8ba38ad0e Mon Sep 17 00:00:00 2001 From: sylarchen1389 Date: Sat, 8 Nov 2025 23:34:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 829c179230..580d648f67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,16 +32,6 @@ ENV HTTP_PROXY=http://host.docker.internal:7897 ENV HTTPS_PROXY=http://host.docker.internal:7897 ENV NO_PROXY=localhost,127.0.0.1 -# 增加 npm 超时时间 -RUN npm config set fetch-timeout 600000 && \ - npm config set fetch-retries 5 && \ - npm config set fetch-retry-mintimeout 20000 && \ - npm config set fetch-retry-maxtimeout 120000 - -# 配置 git 使用代理(某些包通过 git 下载) -RUN git config --global http.proxy http://host.docker.internal:7897 && \ - git config --global https.proxy http://host.docker.internal:7897 - # Set Node.js options (heap limit Allocation failed - JavaScript heap out of memory) # ENV NODE_OPTIONS="--max-old-space-size=4096" @@ -52,7 +42,18 @@ WORKDIR /app # to store git revision in build RUN apk add --no-cache git +# 配置 git 使用代理(某些包通过 git 下载) +RUN git config --global http.proxy http://host.docker.internal:7897 && \ + git config --global https.proxy http://host.docker.internal:7897 + COPY package.json package-lock.json ./ + +# 增加 npm 超时时间 +RUN npm config set fetch-timeout 600000 && \ + npm config set fetch-retries 5 && \ + npm config set fetch-retry-mintimeout 20000 && \ + npm config set fetch-retry-maxtimeout 120000 + # RUN npm ci --force RUN npm install --legacy-peer-deps