initial commit
This commit is contained in:
22
apps/backend/docker-entrypoint.sh
Normal file
22
apps/backend/docker-entrypoint.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "Running database migrations..."
|
||||
max_retries=30
|
||||
i=0
|
||||
until [ $i -ge $max_retries ]; do
|
||||
if bun run --cwd apps/backend prisma:migrate:deploy 2>&1; then
|
||||
echo "Migrations complete"
|
||||
break
|
||||
fi
|
||||
i=$((i + 1))
|
||||
echo "Migration attempt $i failed, retrying in 2s..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
if [ $i -ge $max_retries ]; then
|
||||
echo "Failed to run migrations after $max_retries attempts"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user