File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 1- FROM node:24-alpine
1+ # --------------------------
2+ # Next.js 15 Standalone + Payload CMS Dockerfile
3+ # 构建阶段已经在 CI 完成
4+ # --------------------------
5+ FROM --platform=$TARGETPLATFORM node:24-alpine
26
7+ # 工作目录
38WORKDIR /app
49ENV NODE_ENV=production
510
11+ # 安装 sharp 运行依赖
12+ RUN apk add --no-cache vips fftw python3 build-base
13+
14+ # 拷贝 CI 构建产物
615COPY .next/standalone ./
716COPY .next/static ./.next/static
817COPY public ./public
18+ COPY package*.json ./
19+
20+ # 安装依赖(optionalDependencies 如 sharp,针对当前平台)
21+ RUN npm ci --include=optional --omit=dev
922
23+ # 暴露端口
1024EXPOSE 3000
25+
26+ # 启动 Next.js / Payload
1127CMD ["node", "server.js"]
Original file line number Diff line number Diff line change 1- # To use this Dockerfile, you have to set `output: 'standalone'` in your next.config.js file.
1+ # Dockerfile
22# From https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
33
4- FROM node:22.17.0 -alpine AS base
4+ FROM node:24 -alpine AS base
55
66# Install dependencies only when needed
77FROM base AS deps
@@ -48,7 +48,6 @@ ENV NODE_ENV production
4848RUN addgroup --system --gid 1001 nodejs
4949RUN adduser --system --uid 1001 nextjs
5050
51- # Remove this line if you do not have this folder
5251COPY --from=builder /app/public ./public
5352
5453# Set the correct permission for prerender cache
You can’t perform that action at this time.
0 commit comments