services: openwebui: image: ghcr.io/open-webui/open-webui:main container_name: open-webui ports: - "4080:8080" volumes: - open-webui:/app/backend/data env_file: - .env environment: ENABLE_OPENAI_API: true OPENAI_API_BASE_URL: "http://litellm:4000" ENABLE_OLLAMA_API: false ENABLE_IMAGE_GENERATION: true IMAGE_SIZE: "1024x1024" IMAGE_GENERATION_MODEL: "Dall-e 3" ENABLE_WEB_SEARCH: true ENABLE_RAG_WEB_SEARCH: True RAG_WEB_SEARCH_ENGINE: "searxng" RAG_WEB_SEARCH_RESULT_COUNT: 3 RAG_WEB_SEARCH_CONCURRENT_REQUESTS: 10 SEARXNG_QUERY_URL: "https://search.${DOMAIN}/search?q=" WEB_SEARCH_ENGINE: "searxng" OAUTH_PROVIDER_NAME: "authentik" OPENID_PROVIDER_URL: "https://auth.${DOMAIN}/application/o/openwebui/.well-known/openid-configuration" OPENID_REDIRECT_URI: "https://ai.${DOMAIN}/oauth/oidc/callback" ENABLE_OAUTH_SIGNUP: true ENABLE_LOGIN_FORM: false AUDIO_STT_ENGINE: "azure" AUDIO_STT_AZURE_REGION: "swedencentral" AUDIO_TTS_ENGINE: "azure" AUDIO_TTS_AZURE_SPEECH_REGION: "swedencentral" labels: - "com.centurylinklabs.watchtower.enable=true" litellm: container_name: litellm image: ghcr.io/berriai/litellm:main-stable volumes: - ./litellm-config.yaml:/app/config.yaml command: - "--config=/app/config.yaml" ports: - "4000:4000" # Map the container port to the host, change the host port if necessary environment: DATABASE_URL: "postgresql://llmproxy:Develop9090@db:5432/litellm" env_file: - .env # Load local .env file depends_on: - db # Indicates that this service depends on the 'db' service, ensuring 'db' starts first healthcheck: # Defines the health check configuration for the container test: [ "CMD", "curl", "-f", "http://localhost:4000/health/liveliness || exit 1", ] # Command to execute for health check interval: 30s # Perform health check every 30 seconds timeout: 10s # Health check command times out after 10 seconds retries: 3 # Retry up to 3 times if health check fails start_period: 40s # Wait 40 seconds after container start before beginning health checks labels: - "com.centurylinklabs.watchtower.enable=true" db: image: postgres:16 restart: always container_name: litellm_db environment: POSTGRES_DB: litellm POSTGRES_USER: llmproxy POSTGRES_PASSWORD: Develop9090 volumes: - postgres_data:/var/lib/postgresql/data # Persists Postgres data across container restarts healthcheck: test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"] interval: 1s timeout: 5s retries: 10 volumes: open-webui: postgres_data: name: litellm_postgres_data # Named volume for Postgres data persistence