Skip to content

Commit 2d37870

Browse files
committed
docs
1 parent ece0b66 commit 2d37870

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,32 +283,38 @@ Here is an example `Dockerfile` which can serve any Node application:
283283

284284
```Dockerfile
285285
# ---- Build Stage ----
286-
FROM node:22-alpine AS builder
286+
FROM public.ecr.aws/docker/library/node:22-alpine AS builder
287287
288288
WORKDIR /app
289289
290290
# Copy all files
291291
COPY . .
292292
293+
# Install pnpm
294+
RUN corepack enable && corepack prepare pnpm@latest --activate
295+
293296
# Install dependencies
294-
RUN npm install
297+
RUN pnpm install
295298
296299
# Build Next.js app
297-
RUN npm run build
300+
RUN pnpm run build
298301
299302
# ---- Production Stage ----
300-
FROM node:22-alpine AS runner
303+
FROM public.ecr.aws/docker/library/node:22-alpine AS runner
301304
302305
WORKDIR /app
303306
304307
ENV NODE_ENV=production
305308
309+
# Install pnpm in production image
310+
RUN corepack enable && corepack prepare pnpm@latest --activate
311+
306312
# Copy only necessary files from builder
307313
COPY --from=builder /app/ ./
308314
309315
EXPOSE 3000
310316
311-
CMD ["npm", "run", "start"]
317+
CMD ["pnpm", "start"]
312318
```
313319

314320
You might want to add a `.dockerignore` to minimize the context size:

0 commit comments

Comments
 (0)