From cb8e24fbeaa83eeb7b676c7dd266705de184f8dd Mon Sep 17 00:00:00 2001 From: Jagger <634750802@qq.com> Date: Tue, 16 Apr 2024 13:34:13 +0800 Subject: [PATCH] try to fix Dockerfile --- Dockerfile | 8 +++++--- package.json | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c472c6d2..377436af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,8 @@ RUN apk add --no-cache libc6-compat WORKDIR /app # Install dependencies based on the preferred package manager COPY . . -RUN corepack enable pnpm && pnpm i +RUN corepack enable +RUN pnpm i # 2. Rebuild the source code only when needed FROM base AS builder @@ -15,13 +16,14 @@ COPY --from=deps /app/node_modules ./node_modules COPY . . # This will do the trick, use the corresponding env file for each environment. # COPY .env.production.sample .env.production -RUN corepack enable pnpm && STANDALONE_BUILD=1 pnpm run build +RUN corepack enable +RUN STANDALONE_BUILD=1 pnpm run build # 3. Production image, copy all the files and run next FROM base AS runner WORKDIR /app ENV NODE_ENV=production -RUN corepack enable pnpm +RUN corepack enable RUN addgroup -g 1001 -S nodejs RUN adduser -S nextjs -u 1001 # Automatically leverage output traces to reduce image size diff --git a/package.json b/package.json index 36bd453e..3dc5f817 100644 --- a/package.json +++ b/package.json @@ -136,6 +136,7 @@ "tailwindcss": "^3.3.0", "typescript": "^5" }, + "packageManager": "pnpm@8.15.7", "pnpm": { "overrides": { "pdfjs-dist>canvas": "file:../_EXCLUDED_"