Skip to content

Instantly share code, notes, and snippets.

@robmurrer
Created August 12, 2025 01:53
Show Gist options
  • Select an option

  • Save robmurrer/48a73a38a1f3b666163266fc653aef6d to your computer and use it in GitHub Desktop.

Select an option

Save robmurrer/48a73a38a1f3b666163266fc653aef6d to your computer and use it in GitHub Desktop.
chadgpt traefik + openwebui + litellm
version: '3.8'
services:
traefik:
image: traefik:v3.0
container_name: ${STACK_NAME:-chad}-traefik
restart: unless-stopped
command:
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --certificatesresolvers.letsencrypt.acme.tlschallenge=true
- --certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL}
- --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
- --certificatesresolvers.letsencrypt.acme.caserver=https://acme-v02.api.letsencrypt.org/directory
- --log.level=INFO
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik-data:/letsencrypt
networks:
- web
labels:
- "traefik.enable=true"
# Redirect HTTP to HTTPS
- "traefik.http.routers.redirect-to-https.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.redirect-to-https.entrypoints=web"
- "traefik.http.routers.redirect-to-https.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
litellm:
image: ghcr.io/berriai/litellm:main-stable
container_name: ${STACK_NAME:-chad}-litellm
restart: unless-stopped
deploy:
resources:
limits:
memory: ${MEMORY_LIMIT:-1.5g}
cpus: '${CPU_LIMIT:-1.5}'
volumes:
- ./litellm-config-processed.yaml:/app/config.yaml:ro
- litellm-data:/app/data
environment:
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY}
- OLLAMA_HOST=${OLLAMA_HOST}
- OLLAMA_PORT=${OLLAMA_PORT}
command: ["--config", "/app/config.yaml", "--port", "4000", "--host", "0.0.0.0"]
labels:
- "traefik.enable=true"
- "traefik.http.routers.litellm.rule=Host(`${DOMAIN}`) && PathPrefix(`/v1`)"
- "traefik.http.routers.litellm.entrypoints=websecure"
- "traefik.http.routers.litellm.tls.certresolver=letsencrypt"
- "traefik.http.services.litellm.loadbalancer.server.port=4000"
networks:
- web
openwebui:
image: ghcr.io/open-webui/open-webui:main
container_name: ${STACK_NAME:-chad}-openwebui
restart: unless-stopped
deploy:
resources:
limits:
memory: ${MEMORY_LIMIT:-1.5g}
cpus: '${CPU_LIMIT:-1.5}'
volumes:
- openwebui-data:/app/backend/data
environment:
- OPENAI_API_BASE_URL=http://litellm:4000/v1
- OPENAI_API_KEY=${LITELLM_MASTER_KEY}
- WEBUI_SECRET_KEY=${WEBUI_SECRET_KEY}
- WEBUI_AUTH=true
- DEFAULT_MODELS=qwen3-coder
- WEBUI_NAME=Chad - AI Coding Assistant
labels:
- "traefik.enable=true"
- "traefik.http.routers.openwebui.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.openwebui.entrypoints=websecure"
- "traefik.http.routers.openwebui.tls.certresolver=letsencrypt"
- "traefik.http.services.openwebui.loadbalancer.server.port=8080"
depends_on:
- litellm
networks:
- web
networks:
web:
driver: bridge
volumes:
traefik-data:
litellm-data:
openwebui-data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment