Files
Jens faeb58ef6d
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
Initial public release
2026-08-31 21:56:53 +02:00

32 lines
833 B
Bash

#!/usr/bin/env sh
set -eu
echo "Waiting for database connection..."
python - <<'PY'
import time
from sqlalchemy import create_engine, text
from app.core.config import get_settings
settings = get_settings()
last_error = None
for attempt in range(1, 31):
try:
engine = create_engine(settings.database_url, pool_pre_ping=True, future=True)
with engine.connect() as connection:
connection.execute(text("SELECT 1"))
print(f"Database connection ready after attempt {attempt}.")
break
except Exception as exc:
last_error = exc
print(f"Database not ready yet ({attempt}/30): {exc}")
time.sleep(2)
else:
raise SystemExit(f"Database did not become ready: {last_error}")
PY
python -m alembic upgrade head
exec uvicorn app.main:app --host 0.0.0.0 --port 8000