修复容器启动:用完整生产依赖覆盖精简 node_modules
迁移脚本独立于 Next 运行时,无法使用打包进产物的依赖, 需要 node_modules 里存在真实的 drizzle-orm 与 mysql2 包。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
af7a144d58
commit
57480cca7d
+3
-1
@@ -19,8 +19,10 @@ ENV NODE_ENV=production \
|
||||
PORT=3000 \
|
||||
HOSTNAME=0.0.0.0
|
||||
|
||||
# standalone 产物自带精简 node_modules(含 mysql2、drizzle-orm)
|
||||
# standalone 产物自带精简 node_modules(仅够 server.js 运行)
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
# 用完整生产依赖覆盖:独立迁移脚本(migrate.mjs)需要真实的 drizzle-orm/mysql2 包
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/public ./public
|
||||
# 数据库迁移资源与脚本
|
||||
|
||||
Reference in New Issue
Block a user