From 87a1372f20047e9c026eb4b2b3318c5507665dc7 Mon Sep 17 00:00:00 2001 From: apple Date: Sat, 14 Mar 2026 16:15:56 +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 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3703c2c3..3fd6263c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,9 @@ 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 +# 清理 pnpm store 并安装依赖 +RUN pnpm store prune || true +RUN pnpm install --frozen-lockfile --strict-peer-dependencies=false # Rebuild the source code only when needed FROM hub.diyla.com/node:${NODE_IMAGE_VERSION} AS builder @@ -26,6 +28,8 @@ ENV DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" # 设置 npm registry 为 npmmirror 镜像源 RUN npm config set registry https://registry.npmmirror.com +# 设置 pnpm 配置 +RUN pnpm config set registry https://registry.npmmirror.com || true RUN npm run build-docker # Production image, copy all the files and run next @@ -49,10 +53,13 @@ RUN set -x \ && apk add --no-cache curl \ && npm install -g pnpm +# 设置 pnpm 配置 +RUN pnpm config set registry https://registry.npmmirror.com || true + # Script dependencies RUN pnpm --allow-build='@prisma/engines' add npm-run-all dotenv chalk semver \ prisma@${PRISMA_VERSION} \ - @prisma/adapter-pg@${PRISMA_VERSION} + @prisma/adapter-pg@${PRISMA_VERSION} --strict-peer-dependencies=false COPY --from=builder --chown=nextjs:nodejs /app/public ./public COPY --from=builder /app/prisma ./prisma