#!/bin/sh
# Migrate, seed, then serve. Alembic is the only thing that touches schema.
set -e

echo "coachpapa: running migrations"
alembic upgrade head

echo "coachpapa: seeding reference data (idempotent)"
python -m scripts.seed

echo "coachpapa: starting uvicorn on :3000"
exec uvicorn app.main:app --host 0.0.0.0 --port 3000 --proxy-headers --forwarded-allow-ips '*'
