name: ${COMPOSE_PROJECT_NAME:-litellm-memory} services: litellm-memory: build: context: . dockerfile: Dockerfile restart: unless-stopped ports: - "127.0.0.1:8000:8000" environment: DATABASE_URL: postgresql://litellm_memory:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}@postgres:5432/litellm_memory?sslmode=disable PUBLIC_BASE_URL: ${PUBLIC_BASE_URL:-http://localhost:8000} SETUP_CODE: ${SETUP_CODE:-} ALLOWED_EMAIL_DOMAIN: ${ALLOWED_EMAIL_DOMAIN:-} REGISTRATION_MODE: domain SHARING_ENABLED: "false" SEARCH_CACHE_MB: ${SEARCH_CACHE_MB:-128} OBSERVABILITY_EXPORT: ${OBSERVABILITY_EXPORT:-none} LOGFIRE_TOKEN: ${LOGFIRE_TOKEN:-} OTLP_TRACES_ENDPOINT: ${OTLP_TRACES_ENDPOINT:-} RECOVERY_MODE: ${RECOVERY_MODE:-false} volumes: - litellm-memory-state:/data depends_on: postgres: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=5)"] interval: 15s timeout: 6s retries: 8 start_period: 90s postgres: image: postgres:17-bookworm restart: unless-stopped environment: POSTGRES_DB: litellm_memory POSTGRES_USER: litellm_memory POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env} volumes: - postgres-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U litellm_memory -d litellm_memory"] interval: 5s timeout: 5s retries: 20 volumes: litellm-memory-state: postgres-data: