Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (92 loc) · 2.84 KB
/
Copy pathdocker-compose.yml
File metadata and controls
97 lines (92 loc) · 2.84 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
# ============================================================================
# goMultiAgentV2 —— 一键三服务编排(server + web + gateway)
#
# 用法:
# cp .env.example .env # 编辑并设置 JWT_SECRET / PROVIDER_ENC_KEY 等
# docker compose up -d --build
#
# 访问:
# 前端(nginx 反代 /api → server):http://localhost:8081
# 后端直连(调试): http://localhost:8080 (GET /health)
# LLM 网关: http://localhost:8088 (GET /healthz)
#
# 数据持久化:server_data 命名卷(SQLite / workspaces / agent-state / 私有技能)。
# ============================================================================
services:
# ---------------- 后端 API + Agent 引擎 ----------------
server:
build:
context: ./server
dockerfile: Dockerfile
container_name: gm-server
restart: unless-stopped
env_file:
- .env
environment:
# 容器内固定端口;其余变量(JWT_SECRET/PROVIDER_ENC_KEY/开关等)优先取自 .env
PORT: "8080"
DB_PATH: "/data/codeagent.db"
WORKSPACE_ROOT: "/data/workspaces"
ARTIFACT_ROOT: "/data/agent-state"
SKILLS_DATA_DIR: "/data/skills"
SKILLS_ROOT: "/app/skills"
# 未显式设置时回落到服务端内置不安全默认值(会在日志告警,生产务必在 .env 设置)
JWT_SECRET: "${JWT_SECRET:-}"
PROVIDER_ENC_KEY: "${PROVIDER_ENC_KEY:-}"
volumes:
- server_data:/data
# 内置共享技能(只读挂载,使 warm-start 能命中仓库 skills/)
- ./skills:/app/skills:ro
ports:
- "8080:8080"
networks:
- gmnet
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# ---------------- 前端静态站(nginx 反代 /api) ----------------
web:
build:
context: ./web
dockerfile: Dockerfile
container_name: gm-web
restart: unless-stopped
depends_on:
server:
condition: service_healthy
ports:
- "8081:80"
networks:
- gmnet
# ---------------- LLM 网关(OpenAI 兼容) ----------------
gateway:
build:
context: ./tool/workbuddyLLMAPI
dockerfile: Dockerfile
container_name: gm-gateway
restart: unless-stopped
env_file:
- .env
environment:
WB_LISTEN: ":8088"
WB_BACKEND: "${WB_BACKEND:-passthrough}"
WB_BASE_URL: "${WB_BASE_URL:-https://api.openai.com/v1}"
WB_API_KEY: "${WB_API_KEY:-}"
ports:
- "8088:8088"
networks:
- gmnet
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8088/healthz"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
volumes:
server_data:
networks:
gmnet:
driver: bridge