-
Notifications
You must be signed in to change notification settings - Fork 9
/
compose.auth.yaml
69 lines (69 loc) · 1.65 KB
/
compose.auth.yaml
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
---
services:
node1: &node
image: "redis:${REDIS_VERSION:-7}"
command: >
redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
--requirepass '!&<123-abc>'
--masterauth '!&<123-abc>'
--appendonly yes
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 5000
restart: "${RESTART_POLICY:-always}"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: "7s"
timeout: "5s"
retries: 10
ports:
- "6379:6379"
node2:
<<: *node
ports:
- "6380:6379"
node3:
<<: *node
ports:
- "6381:6379"
node4:
<<: *node
ports:
- "6382:6379"
node5:
<<: *node
ports:
- "6383:6379"
node6:
<<: *node
ports:
- "6384:6379"
clustering:
image: "redis:${REDIS_VERSION:-7}"
command: >
bash -c "apt-get update > /dev/null
&& apt-get install --no-install-recommends --no-install-suggests -y dnsutils > /dev/null
&& rm -rf /var/lib/apt/lists/*
&& yes yes | redis-cli -a '!&<123-abc>' --cluster create
$$(dig node1 +short):6379
$$(dig node2 +short):6379
$$(dig node3 +short):6379
$$(dig node4 +short):6379
$$(dig node5 +short):6379
$$(dig node6 +short):6379
--cluster-replicas 1"
depends_on:
node1:
condition: service_healthy
node2:
condition: service_healthy
node3:
condition: service_healthy
node4:
condition: service_healthy
node5:
condition: service_healthy
node6:
condition: service_healthy