-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
377 lines (348 loc) · 9.25 KB
/
docker-compose.yml
File metadata and controls
377 lines (348 loc) · 9.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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# ╔══════════════════════════════════════════════════════════════════╗
# ║ NexusAgent — Docker Compose (Development) ║
# ║ 启动命令: docker compose up -d ║
# ║ 注意:首先复制 .env.example → .env 并填入实际配置 ║
# ╚══════════════════════════════════════════════════════════════════╝
version: "3.9"
x-java-common: &java-common
build:
context: .
dockerfile: Dockerfile.java
environment: &java-env
MYSQL_URL: jdbc:mysql://mysql:3306/nexus_agent?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
MYSQL_USERNAME: ${MYSQL_USERNAME:-nexus}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-nexus_pass}
REDIS_HOST: redis
REDIS_PORT: 6379
NEXUS_JWT_SECRET: ${NEXUS_JWT_SECRET:-nexus-auth-jwt-secret-key-must-be-at-least-32-characters-long}
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USERNAME:-guest}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD:-guest}
NACOS_ADDR: nacos:8848
SENTINEL_DASHBOARD: sentinel-dashboard:8858
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
nacos:
condition: service_healthy
restart: unless-stopped
networks:
- nexus
x-python-common: &python-common
environment: &python-env
MYSQL_HOST: mysql
MYSQL_PORT: 3306
MYSQL_DB: nexus_agent
MYSQL_USER: ${MYSQL_USERNAME:-nexus}
MYSQL_PASS: ${MYSQL_PASSWORD:-nexus_pass}
REDIS_HOST: redis
REDIS_PORT: 6379
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
OPENAI_BASE_URL: ${OPENAI_BASE_URL:-https://api.openai.com/v1}
LLM_MODEL: ${LLM_MODEL:-gpt-4o}
NACOS_ENABLED: "true"
NACOS_SERVER: nacos:8848
NACOS_NAMESPACE: ${NACOS_NAMESPACE:-}
NACOS_GROUP: DEFAULT_GROUP
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
nacos:
condition: service_healthy
restart: unless-stopped
networks:
- nexus
services:
# ═══════════════════ 基础设施 ═══════════════════
mysql:
image: mysql:8.0
container_name: nexus-mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_DATABASE: nexus_agent
MYSQL_USER: ${MYSQL_USERNAME:-nexus}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-nexus_pass}
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
- ./sql/init:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
networks:
- nexus
redis:
image: redis:7-alpine
container_name: nexus-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks:
- nexus
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: nexus-rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME:-guest}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-guest}
volumes:
- rabbitmq-data:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "check_running"]
interval: 10s
timeout: 5s
retries: 5
networks:
- nexus
chromadb:
image: chromadb/chroma:latest
container_name: nexus-chromadb
ports:
- "8000:8000"
volumes:
- chroma-data:/chroma/chroma
networks:
- nexus
nacos:
image: nacos/nacos-server:v2.4.3
container_name: nexus-nacos
environment:
MODE: standalone
SPRING_DATASOURCE_PLATFORM: ""
NACOS_AUTH_ENABLE: "false"
ports:
- "8848:8848"
- "9848:9848"
volumes:
- nacos-data:/home/nacos/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8848/nacos/actuator/health"]
interval: 10s
timeout: 5s
retries: 10
networks:
- nexus
sentinel-dashboard:
image: bladex/sentinel-dashboard:1.8.8
container_name: nexus-sentinel
ports:
- "8858:8858"
environment:
JAVA_OPTS: "-Dserver.port=8858 -Dcsp.sentinel.dashboard.server=localhost:8858"
networks:
- nexus
# ═══════════════════ Java 微服务 ═══════════════════
gateway:
<<: *java-common
container_name: nexus-gateway
build:
context: .
dockerfile: Dockerfile.java
args:
MODULE: nexus-gateway
ports:
- "8080:8080"
auth:
<<: *java-common
container_name: nexus-auth
build:
context: .
dockerfile: Dockerfile.java
args:
MODULE: nexus-auth
ports:
- "8002:8002"
tenant:
<<: *java-common
container_name: nexus-tenant
build:
context: .
dockerfile: Dockerfile.java
args:
MODULE: nexus-tenant
ports:
- "8003:8003"
session:
<<: *java-common
container_name: nexus-session
build:
context: .
dockerfile: Dockerfile.java
args:
MODULE: nexus-session
ports:
- "8004:8004"
platform:
<<: *java-common
container_name: nexus-platform
build:
context: .
dockerfile: Dockerfile.java
args:
MODULE: nexus-platform
ports:
- "8005:8005"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
agent-config:
<<: *java-common
container_name: nexus-agent-config
build:
context: .
dockerfile: Dockerfile.java
args:
MODULE: nexus-agent-config
ports:
- "8006:8006"
knowledge:
<<: *java-common
container_name: nexus-knowledge
build:
context: .
dockerfile: Dockerfile.java
args:
MODULE: nexus-knowledge
ports:
- "8007:8007"
volumes:
- upload-data:/data/uploads
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
billing:
<<: *java-common
container_name: nexus-billing
build:
context: .
dockerfile: Dockerfile.java
args:
MODULE: nexus-billing
ports:
- "8008:8008"
# ═══════════════════ Python 微服务 ═══════════════════
agent-engine:
<<: *python-common
environment:
NACOS_SERVICE_NAME: nexus-agent-engine
container_name: nexus-agent-engine
build:
context: ./python-services/agent-engine
dockerfile: Dockerfile
ports:
- "8001:8001"
environment:
<<: *python-env
TOOL_REGISTRY_URL: http://tool-registry:8011
SANDBOX_URL: http://sandbox:8020
RAG_SERVICE_URL: http://rag-service:8013
MEMORY_SERVICE_URL: http://memory-service:8012
llm-proxy:
<<: *python-common
environment:
NACOS_SERVICE_NAME: nexus-llm-proxy
container_name: nexus-llm-proxy
build:
context: ./python-services/llm-proxy
dockerfile: Dockerfile
ports:
- "8010:8010"
tool-registry:
<<: *python-common
environment:
NACOS_SERVICE_NAME: nexus-tool-registry
container_name: nexus-tool-registry
build:
context: ./python-services/tool-registry
dockerfile: Dockerfile
ports:
- "8011:8011"
memory-service:
<<: *python-common
environment:
NACOS_SERVICE_NAME: nexus-memory-service
container_name: nexus-memory-service
build:
context: ./python-services/memory-service
dockerfile: Dockerfile
ports:
- "8012:8012"
rag-service:
<<: *python-common
environment:
NACOS_SERVICE_NAME: nexus-rag-service
container_name: nexus-rag-service
build:
context: ./python-services/rag-service
dockerfile: Dockerfile
ports:
- "8013:8013"
environment:
<<: *python-env
CHROMA_HOST: chromadb
CHROMA_PORT: 8000
embed-worker:
<<: *python-common
container_name: nexus-embed-worker
build:
context: ./python-services/embed-worker
dockerfile: Dockerfile
environment:
<<: *python-env
CHROMA_HOST: chromadb
CHROMA_PORT: 8000
depends_on:
mysql:
condition: service_healthy
rabbitmq:
condition: service_healthy
sandbox-service:
<<: *python-common
environment:
NACOS_SERVICE_NAME: nexus-sandbox-service
container_name: nexus-sandbox
build:
context: ./python-services/sandbox-service
dockerfile: Dockerfile
ports:
- "8020:8020"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
privileged: true
volumes:
mysql-data:
redis-data:
rabbitmq-data:
chroma-data:
upload-data:
nacos-data:
networks:
nexus:
driver: bridge