Files
cloudy/swarm/openwebui.yml
T

118 lines
2.9 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:/data
environment:
- IS_PERSISTENT=TRUE
- ALLOW_RESET=TRUE
- PERSIST_DIRECTORY=/data
- ANONYMIZED_TELEMETRY=False
- CHROMA_SERVER_HOST=0.0.0.0
expose:
- 8000
networks:
- net
deploy:
placement:
constraints:
- node.labels.open_webui.open_webui == true
replicas: 1
restart_policy:
condition: any
delay: 5s
max_attempts: 3
healthcheck:
test: ["CMD-SHELL", "timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8000' || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
ollama:
hostname: ollama
image: ollama/ollama:latest
volumes:
- ollama:/root/.ollama
expose:
- 11434
networks:
- net
deploy:
placement:
constraints:
- node.labels.open_webui.open_webui == true
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