Fix Dockerfile for NextAuth + Prisma deployment

Add Prisma support to Docker build:
- Run 'prisma generate' during Docker build
- Copy Prisma client and schema to production image
- Remove 'prisma db push' from build script (runs at startup)
- Enable Next.js standalone output mode
- Add db-setup.sh script for runtime migrations

This fixes the deployment failure where Prisma wasn't available.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-17 15:36:44 -08:00
parent bbb22f1c37
commit 65ea7ac180
3 changed files with 17 additions and 2 deletions

7
scripts/db-setup.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
# Run database migrations at container startup
# This ensures DATABASE_URL is available from Coolify env vars
echo "Running Prisma DB setup..."
npx prisma db push --accept-data-loss --skip-generate
echo "Database setup complete!"