Files
cloudy/swarm/openwebui.yml
T

110 lines
2.7 KiB
YAML

networks:
net:
driver: overlay
attachable: true
traefik-public:
external: true
volumes:
open_webui: {}
chromadb: {}
ollama: {}
# hf-hub-cache: {}
services:
open_webui:
image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG:-main}
depends_on:
- chromadb
- ollama
environment:
- CHROMA_HTTP_PORT=8000
- CHROMA_HTTP_HOST=chromadb
- CHROMA_TENANT=default_tenant
- VECTOR_DB=chroma
- DATA_DIR=/app/backend/data
- DOMAIN=${DOMAIN}
- PORT=${OPEN_WEBUI_PORT:-8080}
- WEBUI_URL=http://localhost:${OPEN_WEBUI_PORT:-8080}
- ENABLE_OLLAMA_API=${ENABLE_OLLAMA_API:-true}
# - CORS_ALLOW_ORIGIN="*"
- OLLAMA_BASE_URLS=http://ollama:11434
- RAG_EMBEDDING_ENGINE=ollama
- RAG_EMBEDDING_MODEL=nomic-embed-text-v1.5
- RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE="True"
volumes:
- open_webui:/app/backend/data
expose:
- ${OPEN_WEBUI_PORT:-8080}
networks:
- net
- traefik-public
deploy:
placement:
constraints:
- node.labels.open_webui.open_webui == true
labels:
- traefik.enable=true
- traefik.swarm.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.routers.open_webui.entrypoints=https
- traefik.http.routers.open_webui.rule=Host(`bot.${DOMAIN}`)
- traefik.http.routers.open_webui.tls.certresolver=le
- traefik.http.routers.open_webui.service=open_webui_app
- traefik.http.services.open_webui_app.loadbalancer.server.port=${OPEN_WEBUI_PORT:-8080}
replicas: 1
restart_policy:
condition: any
delay: 5s
max_attempts: 3
chromadb:
hostname: chromadb
image: chromadb/chroma:latest
volumes:
- chromadb:/chroma/chroma
environment:
- IS_PERSISTENT=TRUE
- ALLOW_RESET=TRUE
- PERSIST_DIRECTORY=/chroma/chroma
expose:
- 8000
networks:
- net
deploy:
replicas: 1
restart_policy:
condition: any
delay: 5s
max_attempts: 3
healthcheck:
test: ["CMD-SHELL", "curl localhost:8000/api/v1/heartbeat || exit 1"]
interval: 10s
retries: 2
start_period: 5s
timeout: 10s
ollama:
image: ollama/ollama:latest
hostname: ollama
volumes:
- ollama:/root/.ollama
expose:
- 11434
networks:
- net
deploy:
replicas: 1
restart_policy:
condition: any
delay: 5s
max_attempts: 3
# speaches:
# image: ghcr.io/speaches-ai/speaches:latest-cpu
# hostname: speaches
# volumes:
# - hf-hub-cache:/home/ubuntu/.cache/huggingface/hub
# expose:
# - 8000