Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
132 lines (125 loc) · 4.24 KB
/
Copy pathdocker-compose.yml
File metadata and controls
132 lines (125 loc) · 4.24 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
# One-command local stack: API (:5100) + Admin (:5200) + MCP runtime + code sandbox
# Usage: docker compose up --build
# LLM engine: add -f docker-compose.llamacpp.yml (CPU) or -f docker-compose.vllm.yml (GPU),
# or point LLM_ENDPOINT at any OpenAI-compatible /v1 server. Falls back to Ollama on the host.
#
# mcp-runtime = hosts MCP stdio servers (e.g. zuora-mcp)
# sandbox-runtime = runs shell/python/node via POST /execute (self-hosted-sandbox)
name: contextmemory
services:
mcp-runtime:
build:
context: .
dockerfile: Dockerfile.mcp-runtime
container_name: contextmemory-mcp-runtime
restart: unless-stopped
environment:
PORT: "8080"
MCP_SESSION_IDLE_MS: "300000"
MCP_DEFAULT_TIMEOUT_MS: "120000"
volumes:
- mcp_packages:/opt/mcps
# Optional scaffold: Azure Log Analytics MCP (stdio)
- ./mcp-runtime/mcps/azure-monitor-mcp:/opt/mcps/azure-monitor-mcp:ro
networks:
- cm-net
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8080/health"]
interval: 15s
timeout: 5s
retries: 8
start_period: 20s
sandbox-runtime:
build:
context: .
dockerfile: Dockerfile.sandbox-runtime
container_name: contextmemory-sandbox-runtime
restart: unless-stopped
environment:
PORT: "8080"
SANDBOX_TIMEOUT_MS: "60000"
SANDBOX_MAX_OUTPUT_CHARS: "32000"
SANDBOX_ALLOW_EGRESS: "true"
# Lab bootstrap only — prefer Admin MCP credentials Env (azure-monitor / github).
# AZURE_TENANT_ID: ""
# AZURE_CLIENT_ID: ""
# AZURE_CLIENT_SECRET: ""
# LOG_ANALYTICS_WORKSPACE_ID: ""
# GITHUB_TOKEN: ""
networks:
- cm-net
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8080/health"]
interval: 15s
timeout: 5s
retries: 8
start_period: 15s
api:
build:
context: .
dockerfile: Dockerfile
container_name: contextmemory-api
restart: unless-stopped
ports:
- "${API_PORT:-5100}:8080"
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://+:8080
ContextMemory__PersistenceProvider: ${PERSISTENCE_PROVIDER:-File}
ContextMemory__DataPath: /app/data
ContextMemory__LlmEndpoint: ${LLM_ENDPOINT:-}
ContextMemory__OllamaEndpoint: ${OLLAMA_ENDPOINT:-http://host.docker.internal:11434}
ContextMemory__OpenAiEndpoint: ${OPENAI_ENDPOINT:-https://api.openai.com}
ContextMemory__OpenAiApiKey: ${OPENAI_API_KEY:-}
ContextMemory__DefaultLlmModel: ${DEFAULT_LLM_MODEL:-qwen3.5:9b}
ContextMemory__MasterKey: ${MASTER_KEY:-cm_master_dev_key_change_me}
ContextMemory__McpRuntimeUrl: http://mcp-runtime:8080
ContextMemory__AdminCorsOrigins__0: ${ADMIN_PUBLIC_URL:-http://localhost:5200}
ContextMemory__Apps__demo-dev__ApiKey: ${DEMO_APP_API_KEY:-cm_live_dev_key_change_me}
ContextMemory__Apps__demo-dev__SystemPrompt: You are a helpful, clear, and precise assistant.
ContextMemory__Apps__demo-dev__DefaultLanguage: en-US
ContextMemory__Apps__demo-dev__LlmModel: ${DEFAULT_LLM_MODEL:-qwen3.5:9b}
volumes:
- cm_data:/app/data
depends_on:
mcp-runtime:
condition: service_healthy
sandbox-runtime:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- cm-net
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8080/health"]
interval: 15s
timeout: 10s
retries: 8
start_period: 60s
admin:
build:
context: .
dockerfile: Dockerfile.admin
container_name: contextmemory-admin
restart: unless-stopped
ports:
- "${ADMIN_PORT:-5200}:8080"
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://+:8080
# Server-side HttpClient talks to the API container on the Docker network
Admin__DefaultApiBaseUrl: http://api:8080
Admin__PublicApiBaseUrl: ${PUBLIC_API_URL:-http://localhost:5100}
Admin__DefaultMasterKey: ${MASTER_KEY:-cm_master_dev_key_change_me}
ApiBaseUrl: http://api:8080
depends_on:
api:
condition: service_healthy
networks:
- cm-net
volumes:
cm_data:
mcp_packages:
networks:
cm-net:
driver: bridge