diff --git a/README.md b/README.md index a06778c..c61da98 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ This Docker Compose configuration outlines a complete setup for running local AI - **Function**: Serves as the web interface for interacting with the Ollama AI models. - **Customization**: Adjust `OLLAMA_API_BASE_URL` to match the internal network URL of the `ollama` service. If running `ollama` on the docker host, comment out the existing `OLLAMA_API_BASE_URL` and use the provided alternative. +### chromadb +- **Image**: `chromadb/chroma` +- **Function**: Provides vector storage for the AI models, enabling efficient data retrieval and management. + ### ollama (Optional if you are running ollama on the docker host) - **Image**: `ollama/ollama` - **Function**: Acts as the AI model server, with the capability to utilize NVIDIA GPUs for model inference. diff --git a/docker-compose.yml b/docker-compose.yml index b434a36..40465c9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3.8" + services: webui: @@ -8,6 +8,9 @@ services: ports: - 8080:8080/tcp environment: + - CHROMA_HTTP_HOST=chromadb + - ENABLE_WEB_SEARCH=true + - WEB_SEARCH_ENGINE=duckduckgo - OLLAMA_BASE_URL=http://ollama:11434 # uncomment the following if you are running ollama on the docker host and remove the ollama service below #- OLLAMA_BASE_URL=http://host.docker.internal:11434 @@ -15,6 +18,32 @@ services: - open-webui:/app/backend/data depends_on: - ollama + - chromadb + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8080/health" ] + interval: 30s + timeout: 10s + retries: 3 + + chromadb: + image: chromadb/chroma:0.6.3 + volumes: + # Be aware that indexed data are located in "/chroma/chroma/" + # Default configuration for persist_directory in chromadb/config.py + # Read more about deployments: https://docs.trychroma.com/deployment + - chroma-data:/chroma/chroma + command: "--workers 1 --host 0.0.0.0 --port 8000 --proxy-headers --log-config chromadb/log_config.yml --timeout-keep-alive 30" + environment: + - IS_PERSISTENT=TRUE + restart: unless-stopped # possible values are: "no", always", "on-failure", "unless-stopped" + expose: + - 8000/tcp + healthcheck: + # Adjust below to match your container port + test: [ "CMD", "curl", "-f", "http://localhost:8000/api/v1/heartbeat" ] + interval: 30s + timeout: 10s + retries: 3 ollama: image: ollama/ollama @@ -37,13 +66,23 @@ services: tunnel: image: cloudflare/cloudflared:latest + pull_policy: always restart: unless-stopped + expose: + - 20241/tcp environment: - TUNNEL_URL=http://webui:8080 + - TUNNEL_METRICS=0.0.0.0:20241 command: tunnel --no-autoupdate depends_on: - webui + healthcheck: + test: [ "CMD", "cloudflared", "tunnel", "ready" ] + interval: 30s + timeout: 10s + retries: 3 volumes: ollama: open-webui: + chroma-data: