Skip to content

Commit 86ddad5

Browse files
committed
fix sharp
1 parent b1fa712 commit 86ddad5

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

docker/Dockerfile.CI

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
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+
# 工作目录
38
WORKDIR /app
49
ENV NODE_ENV=production
510

11+
# 安装 sharp 运行依赖
12+
RUN apk add --no-cache vips fftw python3 build-base
13+
14+
# 拷贝 CI 构建产物
615
COPY .next/standalone ./
716
COPY .next/static ./.next/static
817
COPY public ./public
18+
COPY package*.json ./
19+
20+
# 安装依赖(optionalDependencies 如 sharp,针对当前平台)
21+
RUN npm ci --include=optional --omit=dev
922

23+
# 暴露端口
1024
EXPOSE 3000
25+
26+
# 启动 Next.js / Payload
1127
CMD ["node", "server.js"]

docker/Dockerfile.example

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
77
FROM base AS deps
@@ -48,7 +48,6 @@ ENV NODE_ENV production
4848
RUN addgroup --system --gid 1001 nodejs
4949
RUN adduser --system --uid 1001 nextjs
5050

51-
# Remove this line if you do not have this folder
5251
COPY --from=builder /app/public ./public
5352

5453
# Set the correct permission for prerender cache

0 commit comments

Comments
 (0)