Add docker-entrypoint.sh to retry DB connection on startup
The app container starts before DNS resolution is ready, causing prisma db push to fail. Entrypoint now retries until the database is reachable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "Waiting for database..."
|
||||
until npx prisma db push --skip-generate 2>/dev/null; do
|
||||
echo "Database not ready, retrying in 3s..."
|
||||
sleep 3
|
||||
done
|
||||
|
||||
echo "Database schema synced. Starting server..."
|
||||
exec node server.js
|
||||
Reference in New Issue
Block a user