-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
96 lines (92 loc) · 2.62 KB
/
docker-compose.yml
File metadata and controls
96 lines (92 loc) · 2.62 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
services:
# Single Redis instance for backward compatibility
redis:
image: redis:latest
command: ["redis-server", "--bind", "0.0.0.0", "--port", "6379"]
ports:
- 6379:6379
restart: 'no'
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# Redis pseudo-cluster nodes for cluster testing
redis-cluster-node-1:
container_name: call-gate-redis-cluster-node-1
image: redis:latest
command: [
"redis-server",
"--bind", "0.0.0.0",
"--port", "7001",
"--cluster-enabled", "yes",
"--cluster-config-file", "nodes-7001.conf",
"--cluster-node-timeout", "5000",
"--cluster-announce-ip", "127.0.0.1",
"--cluster-announce-port", "7001",
"--cluster-announce-bus-port", "17001"
]
network_mode: "host"
restart: 'no'
healthcheck:
test: ["CMD", "redis-cli", "-p", "7001", "ping"]
interval: 5s
timeout: 3s
retries: 5
redis-cluster-node-2:
container_name: call-gate-redis-cluster-node-2
image: redis:latest
command: [
"redis-server",
"--bind", "0.0.0.0",
"--port", "7002",
"--cluster-enabled", "yes",
"--cluster-config-file", "nodes-7002.conf",
"--cluster-node-timeout", "5000",
"--cluster-announce-ip", "127.0.0.1",
"--cluster-announce-port", "7002",
"--cluster-announce-bus-port", "17002"
]
network_mode: "host"
restart: 'no'
healthcheck:
test: ["CMD", "redis-cli", "-p", "7002", "ping"]
interval: 5s
timeout: 3s
retries: 5
redis-cluster-node-3:
container_name: call-gate-redis-cluster-node-3
image: redis:latest
command: [
"redis-server",
"--bind", "0.0.0.0",
"--port", "7003",
"--cluster-enabled", "yes",
"--cluster-config-file", "nodes-7003.conf",
"--cluster-node-timeout", "5000",
"--cluster-announce-ip", "127.0.0.1",
"--cluster-announce-port", "7003",
"--cluster-announce-bus-port", "17003"
]
network_mode: "host"
restart: 'no'
healthcheck:
test: ["CMD", "redis-cli", "-p", "7003", "ping"]
interval: 5s
timeout: 3s
retries: 5
# Redis cluster initialization service
redis-cluster-init:
container_name: call-gate-redis-cluster-init
image: redis:latest
network_mode: "host"
depends_on:
- redis-cluster-node-1
- redis-cluster-node-2
- redis-cluster-node-3
command: >
sh -c "
sleep 10 &&
redis-cli --cluster create 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 --cluster-replicas 0 --cluster-yes
"
restart: 'no'