- Create docker-entrypoint.sh to run prisma migrate deploy before app start - Update Dockerfile to use entrypoint script - Ensures database schema is always up-to-date after deployment - Fixes: CRUD kependudukan error 500 di staging karena tabel belum dibuat Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
14 lines
242 B
Bash
14 lines
242 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
echo "🔄 Running database migrations..."
|
|
cd /app
|
|
bunx prisma migrate deploy || {
|
|
echo "❌ Migration failed!"
|
|
exit 1
|
|
}
|
|
echo "✅ Migrations completed successfully"
|
|
|
|
echo "🚀 Starting application..."
|
|
exec bun start
|