-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
111 lines (105 loc) · 2.78 KB
/
docker-compose.yml
File metadata and controls
111 lines (105 loc) · 2.78 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
services:
postgres:
image: postgres:16-alpine
container_name: rag-postgres
environment:
POSTGRES_USER: raguser
POSTGRES_PASSWORD: password123
POSTGRES_DB: document_db
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U raguser -d document_db" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
redis:
image: redis:7-alpine
container_name: rag-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
qdrant:
image: qdrant/qdrant:latest
container_name: rag-qdrant
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant_data:/qdrant/storage
restart: unless-stopped
# Note: No health check as Qdrant container lacks curl/wget
ollama:
image: ollama/ollama:latest
container_name: rag-ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
restart: unless-stopped
environment:
- OLLAMA_HOST=0.0.0.0
# Note: No health check as Ollama container lacks curl/wget
# Database migration init container
migrate:
build: .
container_name: rag-migrate
environment:
- DATABASE_URL=postgresql://raguser:password123@postgres:5432/document_db # Use sync connection for migration
depends_on:
postgres:
condition: service_healthy
command: [ "uv", "run", "python", "scripts/migrate_db.py" ]
restart: "no" # Run once and exit
api:
build: .
container_name: rag-api
ports:
- "8000:8000"
volumes:
- ./onnx_models:/app/onnx_models:ro # Mount pre-converted ONNX model (read-only)
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_started # No health check available
ollama:
condition: service_started # No health check available
migrate:
condition: service_completed_successfully
environment:
- DATABASE_URL=postgresql+asyncpg://raguser:password123@postgres:5432/document_db
- REDIS_URL=redis://redis:6379/0
- QDRANT_URL=http://qdrant:6333
- OLLAMA_URL=http://ollama:11434
- ENVIRONMENT=docker
restart: unless-stopped
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8000/api/v1/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
volumes:
postgres_data:
driver: local
redis_data:
driver: local
qdrant_data:
driver: local
ollama_data:
driver: local