services: litellm: image: ghcr.io/berriai/litellm:main-latest container_name: litellm restart: unless-stopped ports: - "4000:4000" volumes: - /mnt/docker-data/configs/litellm/config.yaml:/app/config.yaml env_file: - .env command: ["--config", "/app/config.yaml", "--port", "4000"] labels: - "com.centurylinklabs.watchtower.enable=false" mem_limit: 1G depends_on: litellm-db: condition: service_healthy healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:4000/health || exit 1"] interval: 30s timeout: 10s retries: 3 start_period: 60s logging: driver: "json-file" options: max-size: "50m" max-file: "3" litellm-db: image: postgres:15-alpine container_name: litellm-db restart: unless-stopped user: "1024:100" environment: - POSTGRES_DB=litellm - POSTGRES_USER=litellm - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} volumes: - /mnt/docker-data/databases/litellm-db:/var/lib/postgresql/data labels: - "com.centurylinklabs.watchtower.enable=false" mem_limit: 256M healthcheck: test: ["CMD-SHELL", "pg_isready -U litellm -d litellm"] interval: 10s timeout: 5s retries: 5 start_period: 30s logging: driver: "json-file" options: max-size: "50m" max-file: "3"