-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
203 lines (194 loc) · 6.53 KB
/
docker-compose.yml
File metadata and controls
203 lines (194 loc) · 6.53 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
# =============================================================================
# Agentic Forge - Docker Compose Development Environment
# =============================================================================
#
# Quick Start:
# 1. Copy .env.example to .env and add your API keys
# 2. Run: docker compose up --build (first time or after dependency changes)
# 3. Run: docker compose up (subsequent runs - code changes auto-reload)
# 4. Open http://localhost:4040 in your browser
#
# Hot Reload:
# - Python services use uvicorn --reload (changes to src/ auto-restart)
# - Node services use Vite dev server (HMR for instant updates)
# - No rebuild needed for code changes, only for dependency changes
#
# Services:
# - forge-ui: http://localhost:4040 (Chat interface)
# - forge-orchestrator: http://localhost:4041 (LLM agent loop)
# - forge-armory: http://localhost:4042 (MCP gateway)
# - armory-admin-ui: http://localhost:4043 (Admin interface)
# - mcp-weather: http://localhost:4050 (Weather MCP server)
# - mcp-web-search: http://localhost:4051 (Web search MCP server)
#
# =============================================================================
services:
# ---------------------------------------------------------------------------
# Database
# ---------------------------------------------------------------------------
postgres:
image: pgvector/pgvector:pg16 # PostgreSQL 16 with pgvector extension for Tool RAG
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-forge_armory}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5433:5432" # Host port 5433 to avoid conflict with local PostgreSQL
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 5s
timeout: 5s
retries: 5
# ---------------------------------------------------------------------------
# MCP Servers
# ---------------------------------------------------------------------------
mcp-weather:
build:
context: ..
dockerfile: forge-devtools/docker/Dockerfile.python
args:
SERVICE_DIR: mcp-servers/mcp-weather
command: uv run python -m forge_mcp_weather --host 0.0.0.0 --port 4050 --reload
ports:
- "4050:4050"
volumes:
- ../mcp-servers/mcp-weather/src:/app/src:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4050/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
mcp-web-search:
build:
context: ..
dockerfile: forge-devtools/docker/Dockerfile.python
args:
SERVICE_DIR: mcp-servers/mcp-web-search
command: uv run python -m forge_mcp_web_search --host 0.0.0.0 --port 4051 --reload
environment:
BRAVE_API_KEY: ${BRAVE_API_KEY:-}
ports:
- "4051:4051"
volumes:
- ../mcp-servers/mcp-web-search/src:/app/src:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4051/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
# ---------------------------------------------------------------------------
# Core Services
# ---------------------------------------------------------------------------
armory:
build:
context: ..
dockerfile: forge-devtools/docker/Dockerfile.armory
command: >
sh -c "uv run alembic upgrade head &&
uv run armory serve --host 0.0.0.0 --port 4042 --reload"
environment:
ARMORY_DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-forge_armory}
ARMORY_HOST: 0.0.0.0
ARMORY_PORT: 4042
ports:
- "4042:4042"
volumes:
- ../forge-armory/src:/app/src:ro
depends_on:
postgres:
condition: service_healthy
mcp-weather:
condition: service_healthy
mcp-web-search:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4042/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
armory-admin-ui:
build:
context: ..
dockerfile: forge-devtools/docker/Dockerfile.node-dev
args:
SERVICE_DIR: forge-armory/admin-ui
command: bun run dev --host 0.0.0.0 --port 4043
environment:
VITE_API_URL: http://armory:4042
ports:
- "4043:4043"
volumes:
- ../forge-armory/admin-ui/src:/app/src:ro
- ../forge-armory/admin-ui/index.html:/app/index.html:ro
depends_on:
armory:
condition: service_healthy
# One-shot init container to register MCP backends
init-backends:
image: alpine/curl:latest
volumes:
- ./scripts/init-backends.sh:/init-backends.sh:ro
command: /bin/sh /init-backends.sh
environment:
ARMORY_URL: http://armory:4042
depends_on:
armory:
condition: service_healthy
restart: "no"
orchestrator:
build:
context: ..
dockerfile: forge-devtools/docker/Dockerfile.python
args:
SERVICE_DIR: forge-orchestrator
command: uv run orchestrator serve --host 0.0.0.0 --port 4041 --reload
environment:
# LLM Provider - set ONE of these API keys
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY:-}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
# Orchestrator settings
ORCHESTRATOR_ARMORY_URL: http://armory:4042/mcp
ORCHESTRATOR_DEFAULT_MODEL: ${ORCHESTRATOR_DEFAULT_MODEL:-anthropic/claude-sonnet-4}
ORCHESTRATOR_HOST: 0.0.0.0
ORCHESTRATOR_PORT: 4041
ports:
- "4041:4041"
volumes:
- conversations_data:/root/.forge/conversations
- ../forge-orchestrator/src:/app/src:ro
depends_on:
armory:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4041/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
ui:
build:
context: ..
dockerfile: forge-devtools/docker/Dockerfile.node-dev
args:
SERVICE_DIR: forge-ui
command: bun run dev --host 0.0.0.0 --port 4040
environment:
VITE_API_URL: http://localhost:4041
ports:
- "4040:4040"
volumes:
- ../forge-ui/src:/app/src:ro
- ../forge-ui/index.html:/app/index.html:ro
depends_on:
orchestrator:
condition: service_healthy
volumes:
postgres_data:
conversations_data: