-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (85 loc) · 2.31 KB
/
Copy pathdocker-compose.yml
File metadata and controls
92 lines (85 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# docker-compose.yml
# Usage:
# docker-compose up -d ollama # start Ollama first
# docker-compose exec ollama ollama pull mistral # download model
# docker-compose --profile ingestion up ingestion # ingest docs
# docker-compose up -d api ui # start the app
# docker-compose down # stop everything
version: "3.8"
services:
ollama:
image: ollama/ollama:latest
container_name: devdocs-ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
restart: unless-stopped
ingestion:
build:
context: .
dockerfile: Dockerfile
container_name: devdocs-ingestion
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- CHROMA_PERSIST_DIRECTORY=/app/vectorstore
- DATA_DIRECTORY=/app/data/raw
volumes:
- ./data/raw:/app/data/raw:ro
- vectorstore_data:/app/vectorstore
depends_on:
ollama:
condition: service_healthy
command: ["python", "-m", "src.ingestion.run_ingestion"]
profiles:
- ingestion
api:
build:
context: .
dockerfile: Dockerfile
container_name: devdocs-api
ports:
- "8000:8000"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- OLLAMA_MODEL=mistral
- EMBEDDING_MODEL=all-MiniLM-L6-v2
- CHROMA_PERSIST_DIRECTORY=/app/vectorstore
- CHROMA_COLLECTION_NAME=docs
- PIPELINE_MODE=naive
volumes:
- vectorstore_data:/app/vectorstore
depends_on:
ollama:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import httpx; r = httpx.get('http://localhost:8000/health'); exit(0 if r.status_code == 200 else 1)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
ui:
build:
context: .
dockerfile: Dockerfile.ui
container_name: devdocs-ui
ports:
- "8501:8501"
environment:
- API_BASE_URL=http://api:8000
depends_on:
api:
condition: service_healthy
restart: unless-stopped
volumes:
ollama_data:
name: devdocs-ollama-data
vectorstore_data:
name: devdocs-vectorstore-data