#!/bin/sh
# Apply migrations, then serve. `alembic upgrade head` is idempotent, so this
# is safe on every container start/restart. The db healthcheck + compose
# depends_on ensures Postgres is ready before this runs.
set -e
echo "[entrypoint] running migrations..."
alembic upgrade head
echo "[entrypoint] starting uvicorn on :8000..."
exec uvicorn app.main:app --host 0.0.0.0 --port 8000
