From 50e29f88f10870e78b1c1c8cc6a6b9803f269e64 Mon Sep 17 00:00:00 2001 From: apple Date: Sat, 14 Mar 2026 16:09:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9docker=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4cc435f9..3703c2c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ FROM hub.diyla.com/node:${NODE_IMAGE_VERSION} AS deps RUN apk add --no-cache libc6-compat WORKDIR /app COPY package.json pnpm-lock.yaml ./ +# 设置 npm registry 为 npmmirror 镜像源 +RUN npm config set registry https://registry.npmmirror.com RUN npm install -g pnpm RUN pnpm install --frozen-lockfile @@ -22,6 +24,8 @@ ENV BASE_PATH=$BASE_PATH ENV NEXT_TELEMETRY_DISABLED=1 ENV DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" +# 设置 npm registry 为 npmmirror 镜像源 +RUN npm config set registry https://registry.npmmirror.com RUN npm run build-docker # Production image, copy all the files and run next @@ -37,6 +41,10 @@ ENV NODE_OPTIONS=$NODE_OPTIONS RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs + +# 设置 npm registry 为 npmmirror 镜像源 +RUN npm config set registry https://registry.npmmirror.com + RUN set -x \ && apk add --no-cache curl \ && npm install -g pnpm