修复docker缺少远程遥控模块

This commit is contained in:
mtvpls
2026-05-31 16:10:47 +08:00
parent 1405d9ac1b
commit 1231ca2895
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -57,6 +57,10 @@ COPY --from=builder --chown=nextjs:nodejs /app/migrations ./migrations
COPY --from=builder --chown=nextjs:nodejs /app/start.js ./start.js
# 从构建器中复制自定义 server.js(包含 Socket.IO 支持)
COPY --from=builder --chown=nextjs:nodejs /app/server.js ./server.js
# 自定义 server.js 在运行时会 require('./src/lib/tv-remote-hub.js')。
# Next standalone 只会追踪 Next 应用入口,不会自动包含自定义服务器额外 require 的源文件,
# 因此需要显式复制该运行时模块,避免生产镜像启动时报 Cannot find module。
COPY --from=builder --chown=nextjs:nodejs /app/src/lib/tv-remote-hub.js ./src/lib/tv-remote-hub.js
# 从构建器中复制 public 和 .next/static 目录
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static