forked from CodeGraphContext/CodeGraphContext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.plugin-stack.yml
More file actions
158 lines (149 loc) · 5.38 KB
/
docker-compose.plugin-stack.yml
File metadata and controls
158 lines (149 loc) · 5.38 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
# Full CGC plugin stack — self-contained for local development and manual testing.
#
# Includes: Neo4j + CGC core + OTEL collector + OTEL processor.
# Add Xdebug listener with: -f docker-compose.dev.yml
#
# Quick start:
# cp .env.example .env # edit NEO4J_PASSWORD at minimum
# docker compose -f docker-compose.plugin-stack.yml up -d
# docker compose -f docker-compose.plugin-stack.yml logs -f
#
# With Xdebug (dev):
# docker compose -f docker-compose.plugin-stack.yml -f docker-compose.dev.yml up -d
#
# Verify:
# docker compose -f docker-compose.plugin-stack.yml ps
# curl -s http://localhost:7474 # Neo4j Browser
# grpcurl -plaintext localhost:4317 list # OTEL gRPC endpoint (needs grpcurl)
version: '3.8'
services:
# ── Neo4j graph database ───────────────────────────────────────────────────
neo4j:
image: neo4j:2026.02.2
container_name: cgc-neo4j
ports:
- "7474:7474" # Browser: http://localhost:7474
- "7687:7687" # Bolt
environment:
- NEO4J_AUTH=${NEO4J_USERNAME:-neo4j}/${NEO4J_PASSWORD:-codegraph123}
- NEO4J_PLUGINS=["apoc"]
- NEO4J_server_memory_heap_max__size=2G
volumes:
- neo4j-data:/data
- neo4j-logs:/logs
- ./config/neo4j/init.cypher:/docker-entrypoint-initdb.d/init.cypher:ro
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:7474 || exit 1"]
interval: 15s
timeout: 10s
retries: 5
start_period: 30s
networks:
- cgc-network
restart: unless-stopped
# ── CGC core MCP server ────────────────────────────────────────────────────
cgc-core:
build:
context: .
dockerfile: Dockerfile
container_name: cgc-core
environment:
- DATABASE_TYPE=neo4j
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USERNAME=${NEO4J_USERNAME:-neo4j}
- NEO4J_PASSWORD=${NEO4J_PASSWORD:-codegraph123}
- PYTHONUNBUFFERED=1
volumes:
- ./:/workspace
- cgc-data:/root/.codegraphcontext
stdin_open: true
tty: true
depends_on:
neo4j:
condition: service_healthy
networks:
- cgc-network
restart: unless-stopped
# ── CGC hosted MCP server (HTTP transport) ────────────────────────────────
# Serves MCP over HTTP on port 8045 for remote clients (e.g. web IDEs,
# hosted agents). Distinct from cgc-core which uses stdio for local IDEs.
cgc-mcp:
build:
context: .
dockerfile: Dockerfile.mcp
container_name: cgc-mcp
environment:
- DATABASE_TYPE=${DATABASE_TYPE:-neo4j}
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USERNAME=${NEO4J_USERNAME:-neo4j}
- NEO4J_PASSWORD=${NEO4J_PASSWORD:-codegraph123}
- CGC_CORS_ORIGIN=${CGC_CORS_ORIGIN:-*}
- CGC_MCP_PORT=${CGC_MCP_PORT:-8045}
ports:
- "${CGC_MCP_PORT:-8045}:8045"
depends_on:
neo4j:
condition: service_healthy
networks:
- cgc-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8045/healthz"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# ── OpenTelemetry Collector ────────────────────────────────────────────────
# Receives spans from your application (ports 4317 gRPC, 4318 HTTP),
# filters noise, and forwards to cgc-otel-processor.
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
container_name: cgc-otel-collector
command: ["--config=/etc/otelcol/config.yaml"]
volumes:
- ./config/otel-collector/config.yaml:/etc/otelcol/config.yaml:ro
ports:
- "4317:4317" # OTLP gRPC — point your app here
- "4318:4318" # OTLP HTTP — alternative ingestion
depends_on:
- cgc-otel-processor
networks:
- cgc-network
restart: unless-stopped
# ── CGC OTEL Processor ────────────────────────────────────────────────────
# Receives filtered spans from collector, writes Service/Trace/Span nodes
# to Neo4j and correlates them to static Method nodes.
cgc-otel-processor:
build:
context: plugins/cgc-plugin-otel
dockerfile: Dockerfile
container_name: cgc-otel-processor
environment:
- DATABASE_TYPE=neo4j
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USERNAME=${NEO4J_USERNAME:-neo4j}
- NEO4J_PASSWORD=${NEO4J_PASSWORD:-codegraph123}
- OTEL_RECEIVER_PORT=${OTEL_RECEIVER_PORT:-5317}
- OTEL_FILTER_ROUTES=${OTEL_FILTER_ROUTES:-/health,/metrics,/ping}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
ports:
- "5317:5317" # Internal gRPC (collector → processor; not exposed to app)
depends_on:
neo4j:
condition: service_healthy
networks:
- cgc-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "python -c \"import grpc; print('ok')\" || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
volumes:
neo4j-data:
neo4j-logs:
cgc-data:
networks:
cgc-network:
driver: bridge