-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose.cluster-stateless.yml
More file actions
68 lines (63 loc) · 1.71 KB
/
Copy pathdocker-compose.cluster-stateless.yml
File metadata and controls
68 lines (63 loc) · 1.71 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
version: "3.8"
# 3-node MCP-JS cluster in STATELESS mode with nginx load balancer.
# Used for load testing — no heap persistence overhead.
#
# Usage:
# docker compose -f docker-compose.cluster-stateless.yml up --build
#
# The load balancer is accessible at http://localhost:8080/mcp
services:
# ── Nginx load balancer ──────────────────────────────────────────────
lb:
image: nginx:alpine
ports:
- "8080:8080"
volumes:
- ./nginx-cluster.conf:/etc/nginx/nginx.conf:ro
depends_on:
- node1
- node2
- node3
# ── MCP-JS cluster nodes (stateless for benchmarking) ──────────────
node1:
build: .
command:
- --http-port=3000
- --stateless
- --cluster-port=4000
- --node-id=node1
- --peers=node2@node2:4000,node3@node3:4000
- --heartbeat-interval=200
- --election-timeout-min=1000
- --election-timeout-max=2000
expose:
- "3000"
- "4000"
node2:
build: .
command:
- --http-port=3000
- --stateless
- --cluster-port=4000
- --node-id=node2
- --peers=node1@node1:4000,node3@node3:4000
- --heartbeat-interval=200
- --election-timeout-min=1000
- --election-timeout-max=2000
expose:
- "3000"
- "4000"
node3:
build: .
command:
- --http-port=3000
- --stateless
- --cluster-port=4000
- --node-id=node3
- --peers=node1@node1:4000,node2@node2:4000
- --heartbeat-interval=200
- --election-timeout-min=1000
- --election-timeout-max=2000
expose:
- "3000"
- "4000"