diff --git a/docker/web.Dockerfile b/docker/web.Dockerfile index 26e00ba..5963fbb 100644 --- a/docker/web.Dockerfile +++ b/docker/web.Dockerfile @@ -34,6 +34,9 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static # migration: ไฟล์ SQL (drizzle-kit generate) + runner — รันตอน container start COPY --from=builder --chown=nextjs:nodejs /app/drizzle ./drizzle COPY --from=builder --chown=nextjs:nodejs /app/scripts ./scripts +# postgres.js โดน Next บีบ bundle เข้า server chunks — standalone node_modules ไม่มี package นี้ +# แต่ migrate.mjs import มันตรง ๆ → คัดลอกจาก stage deps (v3 ไม่มี dependency ย่อย โฟลเดอร์เดียวพอ) +COPY --from=deps --chown=nextjs:nodejs /app/node_modules/postgres ./node_modules/postgres USER nextjs EXPOSE 3000 # DATABASE_URL ฉีดตอนรันผ่าน env ของ container (อย่าฝังใน image)