Skip to content

Commit

Permalink
try to fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
634750802 committed Apr 16, 2024
1 parent 5fb38b8 commit cb8e24f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"tailwindcss": "^3.3.0",
"typescript": "^5"
},
"packageManager": "[email protected]",
"pnpm": {
"overrides": {
"pdfjs-dist>canvas": "file:../_EXCLUDED_"
Expand Down

0 comments on commit cb8e24f

Please sign in to comment.