-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.mcp.yml
More file actions
191 lines (182 loc) · 7.5 KB
/
Copy pathdocker-compose.mcp.yml
File metadata and controls
191 lines (182 loc) · 7.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
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
# docker-compose.mcp.yml
#
# Optional MCP Context Forge stack for GitPilot. STRICTLY ADDITIVE:
# default `docker compose up` does not see these services because they
# all sit under the `mcp` profile.
#
# Build-from-source strategy (mirrors HomePilot's mcp-servers stack):
# the upstream repos have no published Docker Hub images, so we clone
# them into ./mcp-stack/ during `make install-mcp` and let Compose
# build each image from its Dockerfile. Branches / refs are pinned via
# .mcp.env (MCP_FORGE_REF, MCP_POSTGRE_REF, ...).
#
# Lifecycle:
# make install-mcp clones upstreams into mcp-stack/, seeds .mcp.env
# make run-mcp builds + brings up Forge + 3 reference servers
# make stop-mcp stops the stack (volumes preserved)
# make uninstall-mcp prompts, then removes images + volumes
#
# Industry conventions applied:
# * Profile-based opt-in (Compose v2) — invisible to default `up`
# * build: context from cloned source — reproducible, no registry deps
# * image: gitpilot/<svc>:local — names cached layers
# * Required env vars `${VAR:?}` — fail fast if .mcp.env absent
# * Healthcheck-gated `depends_on` — no startup races
# * Named network — joinable by other stacks
x-mcp-defaults: &mcp-defaults
profiles: ["mcp"]
restart: unless-stopped
networks: [gitpilot-mcp]
services:
# MCP Context Forge — gateway / orchestrator.
# The upstream uses Containerfile (Podman/OCI convention), not Dockerfile.
#
# Critical env vars (required for the local-dev bundled flow):
# HOST=0.0.0.0 Forge's gunicorn config defaults to bind 127.0.0.1
# (mcpgateway/config.py: host: str = "127.0.0.1").
# That makes the in-container healthcheck pass but
# prevents OTHER containers on the same docker
# network from reaching :4444. Override here.
# AUTH_REQUIRED=false Local-dev: lets the registration script's
# POST /gateways succeed without minting JWTs.
# Production: set true and configure JWT_SECRET_KEY
# + a real bearer-token issuer.
# JWT_SECRET_KEY Even when AUTH_REQUIRED=false, Forge logs a
# critical issue if the secret is the literal
# default "my-test-key". We tie it to MCP_AUTH_TOKEN
# so it's per-install unique.
# BASIC_AUTH_PASSWORD Same idea for the admin UI fallback.
mcp-context-forge:
<<: *mcp-defaults
build:
context: ./mcp-stack/mcp-context-forge
dockerfile: Containerfile
image: gitpilot/mcp-context-forge:local
container_name: gitpilot-mcp-context-forge
ports:
- "${MCP_FORGE_PORT:-4444}:4444"
environment:
HOST: 0.0.0.0
PORT: "4444"
AUTH_REQUIRED: "${MCP_FORGE_AUTH_REQUIRED:-false}"
# The signing secret. It is NOT a bearer token — Forge rejects it as one
# (see docs/MCP_AUTH.md), so nothing ever sends it. MCP_AUTH_TOKEN stays
# as the fallback so existing .mcp.env files keep working.
JWT_SECRET_KEY: ${MCP_FORGE_JWT_SECRET:-${MCP_AUTH_TOKEN:?Run "make install-mcp" first or copy .env.template.mcp -> .mcp.env}}
BASIC_AUTH_USER: ${MCP_FORGE_ADMIN_USER:-admin}
BASIC_AUTH_PASSWORD: ${MCP_FORGE_ADMIN_PASSWORD:-${MCP_AUTH_TOKEN}}
# Email login is what the Admin UI and /auth/email/login use; these are
# the credentials `forge_login` exchanges for a JWT.
PLATFORM_ADMIN_EMAIL: ${MCP_FORGE_ADMIN_EMAIL:-admin@example.com}
PLATFORM_ADMIN_PASSWORD: ${MCP_FORGE_ADMIN_PASSWORD:-${MCP_AUTH_TOKEN}}
MCPGATEWAY_UI_ENABLED: "true"
MCPGATEWAY_ADMIN_API_ENABLED: "true"
# Forge marks its session cookie Secure when either of these says so, and
# a browser drops a Secure cookie sent over plain HTTP — which looks
# exactly like "login succeeds, then bounces back to the login page".
# Local dev is HTTP, so both are off here; a TLS deployment sets both.
ENVIRONMENT: ${MCP_FORGE_ENVIRONMENT:-development}
SECURE_COOKIES: "${MCP_FORGE_SECURE_COOKIES:-false}"
LOG_LEVEL: ${MCP_FORGE_LOG_LEVEL:-INFO}
# Lets an adopted Forge (and ours) dial the host on native Linux, where
# host.docker.internal is not defined by default.
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:4444/health || exit 1"]
interval: 10s
timeout: 3s
retries: 6
start_period: 30s
volumes:
- forge-data:/var/lib/forge
# PostgreSQL MCP server (reference) + the database it talks to.
mcp-postgre-server:
<<: *mcp-defaults
build:
context: ./mcp-stack/mcp-postgre-server
image: gitpilot/mcp-postgre-server:local
container_name: gitpilot-mcp-postgre-server
depends_on:
mcp-context-forge:
condition: service_healthy
mcp-postgre-db:
condition: service_healthy
ports:
- "${MCP_POSTGRE_PORT:-8080}:8080"
environment:
POSTGRES_DSN: postgresql://gitpilot:gitpilot@mcp-postgre-db:5432/gitpilot_dev
MCP_AUTH_TOKEN: ${MCP_POSTGRE_TOKEN:-${MCP_AUTH_TOKEN}}
POSTGRES_READ_ONLY: "true"
POSTGRES_BLOCK_DDL: "true"
POSTGRES_BLOCK_DML: "true"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/health || exit 1"]
interval: 10s
retries: 5
start_period: 15s
mcp-postgre-db:
<<: *mcp-defaults
image: postgres:16-alpine
container_name: gitpilot-mcp-postgre-db
environment:
POSTGRES_USER: gitpilot
POSTGRES_PASSWORD: gitpilot
POSTGRES_DB: gitpilot_dev
volumes:
- postgre-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U gitpilot"]
interval: 5s
retries: 10
# Milvus MCP server. The new MCP backend lives in the upstream repo's
# mcp-server/ subdirectory; we point the build context there. Heavy by
# design (Milvus image), so we keep it on the `milvus` sub-profile.
mcp-milvus-server:
build:
context: ./mcp-stack/milvus-admin-ui/mcp-server
image: gitpilot/mcp-milvus-server:local
container_name: gitpilot-mcp-milvus-server
profiles: ["mcp", "milvus"]
restart: unless-stopped
networks: [gitpilot-mcp]
depends_on:
mcp-context-forge:
condition: service_healthy
ports:
- "${MCP_MILVUS_PORT:-8082}:8082"
environment:
MILVUS_URI: ${MILVUS_URI:-http://milvus:19530}
MCP_AUTH_TOKEN: ${MCP_MILVUS_TOKEN:-${MCP_AUTH_TOKEN}}
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8082/health || exit 1"]
interval: 10s
retries: 5
start_period: 15s
# Inspector — light, always on.
mcp-inspector-server:
<<: *mcp-defaults
build:
context: ./mcp-stack/mcp-inspector-server
image: gitpilot/mcp-inspector-server:local
container_name: gitpilot-mcp-inspector-server
depends_on:
mcp-context-forge:
condition: service_healthy
ports:
- "${MCP_INSPECTOR_PORT:-8081}:8081"
environment:
MCP_AUTH_TOKEN: ${MCP_INSPECTOR_TOKEN:-${MCP_AUTH_TOKEN}}
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8081/health || exit 1"]
interval: 10s
retries: 5
start_period: 15s
networks:
gitpilot-mcp:
name: gitpilot-mcp
volumes:
forge-data:
driver: local
postgre-data:
driver: local