services:
  oral-trainer-api:
    build:
      context: ..
      dockerfile: sentence_api/Dockerfile
    restart: unless-stopped
    network_mode: host
    env_file:
      - .env
    command: ["python", "-m", "uvicorn", "sentence_api.main:app", "--host", "${ORAL_TRAINER_BIND_HOST:-127.0.0.1}", "--port", "8000", "--workers", "1", "--proxy-headers", "--forwarded-allow-ips", "*"]
    volumes:
      - ./data:/app/sentence_api/data
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz', timeout=5)"]
      interval: 30s
      timeout: 10s
      retries: 3
