Add environment configuration and Docker Compose setup for Open WebUI and LiteLLM
This commit is contained in:
parent
22697d1913
commit
56ea386f83
3 changed files with 161 additions and 11 deletions
|
|
@ -1,27 +1,85 @@
|
|||
services:
|
||||
openwebui:
|
||||
image: ghcr.io/open-webui/open-webui:main
|
||||
container_name: open-webui
|
||||
ports:
|
||||
- "4000:8080"
|
||||
- "4080:8080"
|
||||
volumes:
|
||||
- open-webui:/app/backend/data
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
WEBUI_URL: https://ai.${DOMAIN}
|
||||
ENABLE_OPENAI_API: true
|
||||
OPENAI_API_BASE_URL: http://open-webui.home:12345
|
||||
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
|
||||
WEB_SEARCH_ENGINE: searxng
|
||||
SEARXNG_QUERY_URL: https://search.${DOMAIN}/search?q=<query>
|
||||
OAUTH_CLIENT_ID: ${OAUTH_CLIENT_ID}
|
||||
OAUTH_CLIENT_SECRET: ${OAUTH_CLIENT_SECRET}
|
||||
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_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=<query>"
|
||||
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:
|
||||
open-webui:
|
||||
postgres_data:
|
||||
name: litellm_postgres_data # Named volume for Postgres data persistence
|
||||
Loading…
Add table
Add a link
Reference in a new issue