Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
233 lines (219 loc) · 6.08 KB
/
Copy pathdocker-compose.yml
File metadata and controls
233 lines (219 loc) · 6.08 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
services:
meilisearch:
image: getmeili/meilisearch:v1.16
ports:
- "7700:7700"
environment:
- MEILI_MASTER_KEY=${MEILI_KEY}
volumes:
- meili_data:/meili_data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7700/health"]
interval: 30s
timeout: 10s
retries: 3
meili-init:
image: curlimages/curl:8.4.0
depends_on:
meilisearch:
condition: service_healthy
environment:
- MEILI_KEY=${MEILI_KEY}
- EMBED_DIM=${EMBED_DIM}
volumes:
- ./scripts/meili-init.sh:/meili-init.sh
command: ["/bin/sh", "/meili-init.sh"]
restart: "no"
tei-embeddings:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-latest
platform: linux/amd64
environment:
- HF_HUB_ENABLE_HF_TRANSFER=1
- HUGGINGFACE_HUB_CACHE=/data
- HF_HOME=/data
volumes:
- tei_model_cache:/data
command: ["--model-id", "sentence-transformers/all-MiniLM-L6-v2", "--hostname", "0.0.0.0"]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
litellm:
image: ghcr.io/berriai/litellm:main-stable
environment:
- LITELLM_PROXY_MASTER_KEY=${PROXY_KEY}
- GROQ_API_KEY=${GROQ_API_KEY}
- LANGSMITH_API_KEY=${LANGSMITH_API_KEY}
- LANGSMITH_PROJECT=${LANGSMITH_PROJECT:-ragops}
- LANGSMITH_BASE_URL=${LANGSMITH_BASE_URL}
volumes:
- ./litellm/config.yaml:/app/config.yaml
command: ["--config", "/app/config.yaml"]
depends_on:
- tei-embeddings
- redis
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:7-alpine
command: ["redis-server", "--save", "60", "1", "--loglevel", "warning"]
volumes:
- redis_data:/data
restart: unless-stopped
backend:
build: ./backend
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
environment:
- MEILI_URL=${MEILI_URL}
- MEILI_KEY=${MEILI_KEY}
- PROXY_URL=${PROXY_URL}
- PROXY_KEY=${PROXY_KEY}
- REDIS_URL=${REDIS_URL}
- LITELLM_MODEL=${LITELLM_MODEL}
- EMBEDDING_MODEL_NAME=${EMBEDDING_MODEL_NAME}
- POSTGRES_URL=${POSTGRES_URL}
- MINIO_ENDPOINT=${MINIO_ENDPOINT}
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
- MINIO_BUCKET=${MINIO_BUCKET}
depends_on:
- meilisearch
- meili-init
- litellm
- tei-embeddings
- redis
- postgres
- minio
restart: unless-stopped
volumes:
- ./tests:/app/tests
ports:
- "18000:8000"
healthcheck:
test: ["CMD", "python", "-c", "import httpx,sys; sys.exit(0) if httpx.get('http://localhost:8000/health',timeout=5).status_code==200 else sys.exit(1)"]
interval: 20s
timeout: 5s
retries: 5
seed:
build: ./backend
command: ["python", "seed_data.py"]
environment:
- MEILI_URL=${MEILI_URL}
- MEILI_KEY=${MEILI_KEY}
- PROXY_URL=${PROXY_URL}
- PROXY_KEY=${PROXY_KEY}
depends_on:
meilisearch:
condition: service_healthy
backend:
condition: service_healthy
litellm:
condition: service_started
tei-embeddings:
condition: service_started
restart: "on-failure"
profiles: ["manual"] # only run manually when needed
ragas_eval:
build: ./backend
command: ["python", "-m", "app.eval.ragas_eval"] # Command to run the script
environment:
- PROXY_URL=${PROXY_URL}
- PROXY_KEY=${PROXY_KEY}
- MEILI_URL=${MEILI_URL}
- MEILI_KEY=${MEILI_KEY}
- LITELLM_MODEL=${LITELLM_MODEL}
- REDIS_URL=${REDIS_URL}
- EMBEDDING_MODEL_NAME=${EMBEDDING_MODEL_NAME}
depends_on:
meilisearch:
condition: service_healthy
litellm:
condition: service_started
tei-embeddings:
condition: service_started
redis:
condition: service_started
restart: "on-failure"
profiles: ["eval"]
prometheus:
image: prom/prometheus:latest
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
command:
- "--config.file=/etc/prometheus/prometheus.yml"
ports:
- "9090:9090"
restart: unless-stopped
depends_on:
- backend
grafana:
image: grafana/grafana:9.0.0
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
restart: unless-stopped
depends_on:
- prometheus
postgres:
image: postgres:15
restart: always
environment:
POSTGRES_USER: ragops
POSTGRES_PASSWORD: ragops
POSTGRES_DB: metadata
volumes:
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ragops -d metadata"]
interval: 10s
timeout: 5s
retries: 5
minio:
image: minio/minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
volumes:
meili_data:
redis_data:
tei_model_cache:
postgres_data:
minio_data:
# nginx: # Optional: behind Traefik or other ingress; enable and map ports only if needed
# image: nginx:alpine
# volumes:
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
# volumes:
# - ./tests:/app/tests
# ports:
# - "8443:443"
# depends_on:
# - backend
# restart: unless-stopped