From 3c6914ed9acdfc1099c49ca040599a75f9d49e71 Mon Sep 17 00:00:00 2001 From: clkj <919284064@qq.com> Date: Thu, 18 Jun 2026 09:32:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8d828a5..d4d1a72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,13 @@ RUN npx prisma generate COPY . . RUN npm run build +# ==================== 🛠️ 关键修复开始 ==================== +# Next.js standalone 模式需要手动将静态文件和 public 复制到 standalone 目录中 +# 这样 server.js 才能在运行时找到并提供这些图片服务 +RUN cp -r public .next/standalone/public +RUN cp -r .next/static .next/standalone/.next/static +# ==================== 🛠️ 关键修复结束 ==================== + # 创建运行用户 RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs