#!/usr/bin/env bash
# Start the FastAPI backend with gunicorn + uvicorn workers.
set -euo pipefail
cd "$(dirname "$0")/../backend"
source ../.venv/bin/activate
exec gunicorn app.main:app \
  --worker-class uvicorn.workers.UvicornWorker \
  --workers "${WEB_WORKERS:-2}" \
  --bind "${BIND:-127.0.0.1:8000}" \
  --timeout 120 \
  --access-logfile ../logs/access.log \
  --error-logfile ../logs/error.log
