Leon4gr45 commited on
Commit
09c1296
·
verified ·
1 Parent(s): 20169a4

Dockerfile: use node:20-alpine to avoid undici assertion error

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -6
Dockerfile CHANGED
@@ -1,8 +1,8 @@
1
- FROM node:22-alpine AS base
2
 
3
  RUN apk add --no-cache libc6-compat
4
  WORKDIR /app
5
- RUN corepack enable pnpm
6
 
7
  # Install dependencies
8
  COPY package.json pnpm-lock.yaml* ./
@@ -14,15 +14,12 @@ ENV NEXT_TELEMETRY_DISABLED 1
14
  RUN pnpm run build
15
 
16
  # Runner
17
- FROM base AS runner
18
  WORKDIR /app
19
  ENV NODE_ENV production
20
  ENV NEXT_TELEMETRY_DISABLED 1
21
 
22
  COPY --from=base /app/public ./public
23
- # .next might already exist if it was copied in the 'COPY . .' step above
24
- # (though it shouldn't be if it's in .dockerignore or not in the context)
25
- # Standalone output already contains .next/standalone
26
  RUN mkdir -p .next && chown node:node .next
27
  COPY --from=base --chown=node:node /app/.next/standalone ./
28
  COPY --from=base --chown=node:node /app/.next/static ./.next/static
 
1
+ FROM node:20-alpine AS base
2
 
3
  RUN apk add --no-cache libc6-compat
4
  WORKDIR /app
5
+ RUN npm install -g pnpm
6
 
7
  # Install dependencies
8
  COPY package.json pnpm-lock.yaml* ./
 
14
  RUN pnpm run build
15
 
16
  # Runner
17
+ FROM node:20-alpine AS runner
18
  WORKDIR /app
19
  ENV NODE_ENV production
20
  ENV NEXT_TELEMETRY_DISABLED 1
21
 
22
  COPY --from=base /app/public ./public
 
 
 
23
  RUN mkdir -p .next && chown node:node .next
24
  COPY --from=base --chown=node:node /app/.next/standalone ./
25
  COPY --from=base --chown=node:node /app/.next/static ./.next/static