Fixed multiple issues preventing the indexer from running: - Docker COPY paths: companion/ → src/companion/ to match project structure - pyproject.toml: [tool.hatchling] → [tool.hatch.build.targets.wheel] - api.py: ChatOrchestrator init params (session_memory instead of http_client) - chunker.py: Fixed character-based chunking (was word-based, causing 400 errors from Ollama embedding API due to exceeding token limits) - config.json: Use exact model tag mxbai-embed-large:335m - docker-compose.yml: Fixed vault mount path
83 lines
1.9 KiB
YAML
83 lines
1.9 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
companion-api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: production
|
|
container_name: companion-api
|
|
ports:
|
|
- "7373:7373"
|
|
volumes:
|
|
- ./config.json:/app/config.json:ro
|
|
- companion-data:/data
|
|
- ./models:/models:ro
|
|
environment:
|
|
- COMPANION_CONFIG=/app/config.json
|
|
- COMPANION_DATA_DIR=/data
|
|
networks:
|
|
- companion-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD",
|
|
"python",
|
|
"-c",
|
|
"import requests; requests.get('http://localhost:7373/health')",
|
|
]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 5s
|
|
|
|
companion-indexer:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.indexer
|
|
container_name: companion-indexer
|
|
volumes:
|
|
- ./config.json:/app/config.json:ro
|
|
- companion-data:/data
|
|
- ./sample-data/Default:/app/sample-data/Default:ro # Mount Obsidian vault as read-only
|
|
environment:
|
|
- COMPANION_CONFIG=/app/config.json
|
|
- COMPANION_DATA_DIR=/data
|
|
- VAULT_PATH=/vault
|
|
networks:
|
|
- companion-network
|
|
restart: unless-stopped
|
|
command: ["python", "-m", "companion.indexer_daemon.watcher"]
|
|
# Or use CLI mode for manual sync:
|
|
# command: ["python", "-m", "companion.indexer_daemon.cli", "index"]
|
|
|
|
# Optional: Ollama for local embeddings and LLM
|
|
ollama:
|
|
image: ollama/ollama:latest
|
|
container_name: companion-ollama
|
|
ports:
|
|
- "11434:11434"
|
|
volumes:
|
|
- ollama-data:/root/.ollama
|
|
networks:
|
|
- companion-network
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
|
|
volumes:
|
|
companion-data:
|
|
driver: local
|
|
ollama-data:
|
|
driver: local
|
|
|
|
networks:
|
|
companion-network:
|
|
driver: bridge
|