# Local disposable stack for public/examples/litellm-budget-verify/verify.mjs
# Not used by site CI. Requires Docker.

services:
  db:
    image: postgres:16
    environment:
      POSTGRES_DB: litellm
      POSTGRES_USER: llmproxy
      POSTGRES_PASSWORD: litellm_budget_verify
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"]
      interval: 2s
      timeout: 5s
      retries: 15

  redis:
    image: redis:7-alpine
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 2s
      timeout: 5s
      retries: 15

  litellm:
    image: docker.litellm.ai/berriai/litellm:main-v1.100.0-stable
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    ports:
      - "4000:4000"
    volumes:
      - ./config.yaml:/app/config.yaml:ro
    command: ["--config=/app/config.yaml", "--port", "4000"]
    environment:
      DATABASE_URL: postgresql://llmproxy:litellm_budget_verify@db:5432/litellm
      LITELLM_MASTER_KEY: sk-litellm-budget-verify-master
      REDIS_HOST: redis
      REDIS_PORT: 6379
    healthcheck:
      test:
        [
          "CMD-SHELL",
          'python3 -c "import urllib.request; urllib.request.urlopen(''http://localhost:4000/health/liveliness'')"',
        ]
      interval: 5s
      timeout: 10s
      retries: 20
      start_period: 30s
