Show prisma db push errors in entrypoint, add .gitattributes for LF
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
*.sh text eol=lf
|
||||
docker-entrypoint.sh text eol=lf
|
||||
+16
-3
@@ -2,10 +2,23 @@
|
||||
set -e
|
||||
|
||||
echo "Waiting for database..."
|
||||
until npx prisma db push --skip-generate 2>/dev/null; do
|
||||
echo "Database not ready, retrying in 3s..."
|
||||
MAX_RETRIES=30
|
||||
RETRY=0
|
||||
|
||||
while [ $RETRY -lt $MAX_RETRIES ]; do
|
||||
if npx prisma db push --skip-generate 2>&1; then
|
||||
echo "Database schema synced successfully."
|
||||
break
|
||||
fi
|
||||
RETRY=$((RETRY + 1))
|
||||
echo "Database not ready (attempt $RETRY/$MAX_RETRIES), retrying in 3s..."
|
||||
sleep 3
|
||||
done
|
||||
|
||||
echo "Database schema synced. Starting server..."
|
||||
if [ $RETRY -ge $MAX_RETRIES ]; then
|
||||
echo "ERROR: Could not connect to database after $MAX_RETRIES attempts."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting server..."
|
||||
exec node server.js
|
||||
|
||||
Reference in New Issue
Block a user