-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
264 lines (251 loc) · 7.25 KB
/
docker-compose.yml
File metadata and controls
264 lines (251 loc) · 7.25 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
volumes:
aperag-postgres-data: {}
aperag-qdrant-data: {}
aperag-redis-data: {}
aperag-es-data: {}
aperag-neo4j-data: {}
aperag-shared-data: {}
services:
# ==============================================
# Application Services (Default startup, excluded from infra)
# ==============================================
api: &api
build:
context: .
dockerfile: ./Dockerfile
image: ${REGISTRY:-docker.io}/apecloud/aperag:${VERSION:-v0.0.0-nightly}
container_name: aperag-api
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
qdrant:
condition: service_healthy
es:
condition: service_healthy
volumes:
- ~/.cache:/root/.cache
- aperag-shared-data:/shared
env_file:
- .env
- envs/docker.env.overrides
environment:
- DOCRAY_HOST=${DOCRAY_HOST}
ports:
- "8000:8000"
command: ["/app/scripts/entrypoint.sh", "/app/scripts/start-api.sh"]
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/health || curl -f http://localhost:8000/docs || exit 1"]
interval: 10s
timeout: 5s
retries: 12 # 12 * 10s = 120s (2 minutes)
start_period: 30s # Give API time to start up before first check
frontend:
build:
context: ./web
dockerfile: ./Dockerfile
image: ${REGISTRY:-docker.io}/apecloud/aperag-frontend:${VERSION:-v0.0.0-nightly}
container_name: aperag-frontend
depends_on:
api:
condition: service_healthy
env_file:
- web/deploy/env.local.template
environment:
- API_SERVER_ENDPOINT=http://api:8000
- API_SERVER_BASE_PATH=/api/v1
ports:
- "3000:3000"
celeryworker:
image: ${REGISTRY:-docker.io}/apecloud/aperag:${VERSION:-v0.0.0-nightly}
build:
context: .
dockerfile: ./Dockerfile
container_name: aperag-celeryworker
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
qdrant:
condition: service_healthy
es:
condition: service_healthy
volumes:
- ~/.cache:/root/.cache
- ./resources:/data/resources
- aperag-shared-data:/shared
env_file:
- .env
- envs/docker.env.overrides
environment:
- NODE_IP=aperag-celeryworker
- DOCRAY_HOST=${DOCRAY_HOST}
- APERAG_API_BASE_URL=http://aperag-api:8000
command: ["/app/scripts/entrypoint.sh", "/app/scripts/start-celery-worker.sh"]
celerybeat:
image: ${REGISTRY:-docker.io}/apecloud/aperag:${VERSION:-v0.0.0-nightly}
build:
context: .
dockerfile: ./Dockerfile
container_name: aperag-celerybeat
env_file:
- .env
- envs/docker.env.overrides
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
environment:
- NODE_IP=aperag-celerybeat
command: ["/app/scripts/entrypoint.sh", "/app/scripts/start-celery-beat.sh"]
flower:
image: ${REGISTRY:-docker.io}/apecloud/aperag:${VERSION:-v0.0.0-nightly}
build:
context: .
dockerfile: ./Dockerfile
container_name: aperag-flower
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
env_file:
- .env
- envs/docker.env.overrides
ports:
- "5555:5555"
environment:
- NODE_IP=aperag-flower
command: ["/app/scripts/entrypoint.sh", "/app/scripts/start-celery-flower.sh"]
# ==============================================
# Infrastructure Services (always available)
# ==============================================
postgres:
image: ${REGISTRY:-docker.io}/apecloud/pgvector:pg16
container_name: aperag-postgres
volumes:
- aperag-postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=aperag
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d aperag"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
redis:
image: ${REGISTRY:-docker.io}/apecloud/redis:6
container_name: aperag-redis
volumes:
- aperag-redis-data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 10s
timeout: 3s
retries: 5
start_period: 5s
qdrant:
image: ${REGISTRY:-docker.io}/apecloud/qdrant:v1.13.4
container_name: aperag-qdrant
volumes:
- aperag-qdrant-data:/qdrant/storage
ports:
- "6333:6333"
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 6333 || timeout 3 bash -c '</dev/tcp/localhost/6333' || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
es:
image: ${REGISTRY:-docker.io}/apecloud/elasticsearch:8.8.2
container_name: aperag-es
ports:
- "9200:9200"
environment:
- "discovery.type=single-node"
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
- "xpack.security.enabled=false"
volumes:
- aperag-es-data:/usr/share/elasticsearch/data
- ./scripts/init-es.sh:/usr/share/elasticsearch/bin/init-es.sh
healthcheck:
test: ["CMD-SHELL", "bash /usr/share/elasticsearch/bin/init-es.sh check"]
interval: 10s
timeout: 5s
retries: 12 # 12 * 10s = 120s (2 minutes)
start_period: 10s # Give ES some time to start up before first check
command: bash /usr/share/elasticsearch/bin/init-es.sh
restart: on-failure
jaeger:
image: jaegertracing/all-in-one:1.60
container_name: aperag-jaeger
ports:
- "16686:16686" # Jaeger UI
- "14268:14268" # HTTP collector
- "14250:14250" # gRPC collector
- "6831:6831/udp" # UDP agent
- "6832:6832/udp" # UDP agent
environment:
- COLLECTOR_OTLP_ENABLED=true
- LOG_LEVEL=info
restart: unless-stopped
profiles: ["jaeger"]
# ==============================================
# Optional Services
# ==============================================
neo4j:
image: neo4j:5.26.5-enterprise
container_name: aperag-neo4j
ports:
- "7474:7474" # HTTP
- "7687:7687" # Bolt
environment:
- NEO4J_AUTH=neo4j/password
- NEO4J_PLUGINS=["apoc"]
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_apoc_export_file_enabled=true
volumes:
- aperag-neo4j-data:/data
profiles: ["neo4j"]
# ==============================================
# DocRay Services (existing profiles)
# ==============================================
docray:
image: ${REGISTRY:-docker.io}/apecloud/doc-ray:${DOCRAY_VERSION:-v0.2.0}
container_name: aperag-docray
ports:
- "8265:8265"
- "8639:8639"
profiles: ["docray"]
environment:
- STANDALONE_MODE=true
deploy:
resources:
reservations:
memory: "8G"
docray-gpu:
image: ${REGISTRY:-docker.io}/apecloud/doc-ray:${DOCRAY_VERSION:-v0.2.0}
container_name: aperag-docray-gpu
ports:
- "8265:8265"
- "8639:8639"
profiles: ["docray-gpu"]
environment:
- STANDALONE_MODE=true
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]