-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.cluster.yml
More file actions
80 lines (75 loc) · 1.91 KB
/
docker-compose.cluster.yml
File metadata and controls
80 lines (75 loc) · 1.91 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
# Multinode cluster setup — Redis Pub/Sub transport (3 nodes + Redis).
#
# Usage:
# docker compose -f docker-compose.cluster.yml up
#
# Set MERIDIAN_SIGNING_KEY to the same value on all nodes (shared secret).
# All nodes expose their public API on different host ports (3000, 3001, 3002).
# Put an L4/L7 load balancer in front of them for production.
services:
redis:
image: redis:7-alpine
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
meridian-1:
build:
context: .
args:
FEATURES: cluster
ports:
- "3000:3000"
volumes:
- meridian_data_1:/data
environment:
MERIDIAN_SIGNING_KEY: ${MERIDIAN_SIGNING_KEY:?MERIDIAN_SIGNING_KEY is required}
REDIS_URL: redis://redis:6379
MERIDIAN_NODE_ID: "1"
MERIDIAN_BIND: "0.0.0.0:3000"
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
meridian-2:
build:
context: .
args:
FEATURES: cluster
ports:
- "3001:3000"
volumes:
- meridian_data_2:/data
environment:
MERIDIAN_SIGNING_KEY: ${MERIDIAN_SIGNING_KEY:?MERIDIAN_SIGNING_KEY is required}
REDIS_URL: redis://redis:6379
MERIDIAN_NODE_ID: "2"
MERIDIAN_BIND: "0.0.0.0:3000"
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
meridian-3:
build:
context: .
args:
FEATURES: cluster
ports:
- "3002:3000"
volumes:
- meridian_data_3:/data
environment:
MERIDIAN_SIGNING_KEY: ${MERIDIAN_SIGNING_KEY:?MERIDIAN_SIGNING_KEY is required}
REDIS_URL: redis://redis:6379
MERIDIAN_NODE_ID: "3"
MERIDIAN_BIND: "0.0.0.0:3000"
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
volumes:
meridian_data_1:
meridian_data_2:
meridian_data_3: