Configure ollama to use external host instead of docker service

- Update all ollama clients to use configurable OLLAMA_URL environment variable
- Remove ollama service from docker-compose.yml to use external ollama instance
- Configure docker-compose to connect to host ollama via 172.17.0.1:11434 (Linux) or host.docker.internal (macOS/Windows)
- Add cross-platform compatibility with extra_hosts mapping
- Update embedding function fallback URL for consistency

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-02 20:29:48 -04:00
parent a640ae5fed
commit 03b033e9a4
5 changed files with 18 additions and 18 deletions

View File

@@ -8,28 +8,18 @@ services:
environment:
- PAPERLESS_TOKEN=${PAPERLESS_TOKEN}
- BASE_URL=${BASE_URL}
- OLLAMA_URL=${OLLAMA_URL:-http://ollama:11434}
- OLLAMA_URL=${OLLAMA_URL:-http://172.17.0.1:11434}
- CHROMADB_PATH=/app/chromadb
- OPENAI_API_KEY=${OPENAI_API_KEY}
volumes:
- chromadb_data:/app/chromadb
depends_on:
- ollama
networks:
- raggr-network
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
networks:
- raggr-network
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
chromadb_data:
ollama_data:
networks:
raggr-network: