Files
geointel/backend/docker_start.sh
T
Jens d5ea270329
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s
Update GeoIntel project files
2026-07-25 23:43:08 +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