Local Compose runs alembic upgrade head after PostgreSQL becomes healthy and
before FastAPI starts:
docker compose up --buildIf your existing local volume was created before Alembic adoption, either mark that schema as the initial revision:
docker compose build migrate
docker compose run --rm migrate uv run alembic stamp bf8b33c13520Or, if the local data is disposable, recreate the local database from the migration history:
docker compose down --volumes
docker compose up --builddown --volumes permanently deletes only this Compose project's local database
volume. Do not use it in production.
Run migrations before starting FastAPI:
uv run alembic upgrade head
uv run fastapi dev app/main.pyAPI documentation remains enabled locally at /docs. Production disables it
through ENABLE_API_DOCS=false.