更新 Dockerfile
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user