docker-compose.yml
1.5 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
# 两个容器:MCP 宿主(挂载全部业务服务)+ 可视化控制台。
#
# 加一条新业务线时**不需要改这个文件** —— 框架会自动发现
# src/mcp_hive/services/ 下的 manifest.py 并挂到 /services/<key>/mcp。
services:
mcp-host:
build: .
image: mcp-hive:local
container_name: mcp-hive-host
env_file: .env
environment:
MCP_PORT: ${MCP_PORT:-53101}
HEALTH_PORT: ${MCP_PORT:-53101}
command: ["mcp-hive-serve", "--all"]
ports:
# AI Agent 直连这个端口,**无鉴权**,只在内网暴露。
- "${MCP_PORT:-53101}:${MCP_PORT:-53101}"
volumes:
# 数据库不可用时,审计降级写到这里,别让记录随容器一起消失
- mcp-logs:/app/logs
restart: unless-stopped
networks: [mcp]
gateway:
build: .
image: mcp-hive:local
container_name: mcp-hive-gateway
env_file: .env
environment:
GATEWAY_PORT: ${GATEWAY_PORT:-53002}
HEALTH_PORT: ${GATEWAY_PORT:-53002}
# 同一个 compose 网络里用容器名互访
MCP_INTERNAL_BASE: "http://mcp-host:${MCP_PORT:-53101}"
command: ["mcp-hive-gateway"]
ports:
- "${GATEWAY_PORT:-53002}:${GATEWAY_PORT:-53002}"
volumes:
- mcp-logs:/app/logs
depends_on:
mcp-host:
# 等 MCP 宿主真的健康了再起控制台,否则首屏全是「服务离线」
condition: service_healthy
restart: unless-stopped
networks: [mcp]
volumes:
mcp-logs:
networks:
mcp:
name: mcp-hive