-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.cluster.yml
More file actions
84 lines (78 loc) · 2.07 KB
/
Copy pathdocker-compose.cluster.yml
File metadata and controls
84 lines (78 loc) · 2.07 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
version: "3.8"
# 3-node MCP-JS cluster with nginx load balancer.
#
# Usage:
# docker compose -f docker-compose.cluster.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 ─────────────────────────────────────────────
node1:
build: .
command:
- --http-port=3000
- --heap-store=dir
- --heap-dir=/data/heaps
- --session-db-path=/data/sessions
- --cluster-port=4000
- --node-id=node1
- --peers=node2@node2:4000,node3@node3:4000
- --heartbeat-interval=200
- --election-timeout-min=1000
- --election-timeout-max=2000
volumes:
- node1-data:/data
expose:
- "3000"
- "4000"
node2:
build: .
command:
- --http-port=3000
- --heap-store=dir
- --heap-dir=/data/heaps
- --session-db-path=/data/sessions
- --cluster-port=4000
- --node-id=node2
- --peers=node1@node1:4000,node3@node3:4000
- --heartbeat-interval=200
- --election-timeout-min=1000
- --election-timeout-max=2000
volumes:
- node2-data:/data
expose:
- "3000"
- "4000"
node3:
build: .
command:
- --http-port=3000
- --heap-store=dir
- --heap-dir=/data/heaps
- --session-db-path=/data/sessions
- --cluster-port=4000
- --node-id=node3
- --peers=node1@node1:4000,node2@node2:4000
- --heartbeat-interval=200
- --election-timeout-min=1000
- --election-timeout-max=2000
volumes:
- node3-data:/data
expose:
- "3000"
- "4000"
volumes:
node1-data:
node2-data:
node3-data: