-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathdocker-compose.redis-sentinel.yml
More file actions
105 lines (100 loc) · 2.57 KB
/
docker-compose.redis-sentinel.yml
File metadata and controls
105 lines (100 loc) · 2.57 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
services:
redis:
image: bitnamilegacy/redis:8.2.1
environment:
- REDIS_REPLICATION_MODE=master
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '6379:6379'
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 5s
retries: 30
redis-slave:
image: bitnamilegacy/redis:8.2.1
depends_on:
redis:
condition: service_healthy
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '6380:6379'
healthcheck:
test: ["CMD-SHELL", "redis-cli ping && redis-cli info replication | grep master_link_status:up"]
interval: 2s
timeout: 5s
retries: 30
redis-sentinel-1:
image: bitnamilegacy/redis-sentinel:8.2.1
depends_on:
redis:
condition: service_healthy
redis-slave:
condition: service_healthy
environment:
- REDIS_MASTER_HOST=127.0.0.1
- REDIS_SENTINEL_ANNOUNCE_IP=127.0.0.1
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '26379:26379'
healthcheck:
test: ["CMD", "redis-cli", "-p", "26379", "ping"]
interval: 2s
timeout: 5s
retries: 30
redis-sentinel-2:
image: bitnamilegacy/redis-sentinel:8.2.1
depends_on:
redis:
condition: service_healthy
redis-slave:
condition: service_healthy
environment:
- REDIS_MASTER_HOST=127.0.0.1
- REDIS_SENTINEL_ANNOUNCE_IP=127.0.0.1
- REDIS_SENTINEL_PORT_NUMBER=26380
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '26380:26380'
healthcheck:
test: ["CMD", "redis-cli", "-p", "26380", "ping"]
interval: 2s
timeout: 5s
retries: 30
redis-sentinel-3:
image: bitnamilegacy/redis-sentinel:8.2.1
depends_on:
redis:
condition: service_healthy
redis-slave:
condition: service_healthy
environment:
- REDIS_MASTER_HOST=127.0.0.1
- REDIS_SENTINEL_ANNOUNCE_IP=127.0.0.1
- REDIS_SENTINEL_PORT_NUMBER=26381
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '26381:26381'
healthcheck:
test: ["CMD", "redis-cli", "-p", "26381", "ping"]
interval: 2s
timeout: 5s
retries: 30
ready:
image: andrewlock/wait-for-dependencies
depends_on:
redis-sentinel-1:
condition: service_healthy
redis-sentinel-2:
condition: service_healthy
redis-sentinel-3:
condition: service_healthy
command: >
redis:6379
redis-slave:6379
redis-sentinel-1:26379
redis-sentinel-2:26380
redis-sentinel-3:26381