-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-valkey-cluster.yaml
More file actions
88 lines (80 loc) · 2.11 KB
/
Copy pathdocker-compose-valkey-cluster.yaml
File metadata and controls
88 lines (80 loc) · 2.11 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
services:
omniq-valkey-c1:
image: valkey/valkey:9-alpine
container_name: omniq-valkey-c1
command: >
valkey-server
--appendonly yes
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 5000
--cluster-announce-port 6379
--cluster-announce-bus-port 16379
volumes:
- valkey_c1_data:/data
omniq-valkey-c2:
image: valkey/valkey:9-alpine
container_name: omniq-valkey-c2
command: >
valkey-server
--appendonly yes
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 5000
--cluster-announce-port 6379
--cluster-announce-bus-port 16379
volumes:
- valkey_c2_data:/data
omniq-valkey-c3:
image: valkey/valkey:9-alpine
container_name: omniq-valkey-c3
command: >
valkey-server
--appendonly yes
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 5000
--cluster-announce-port 6379
--cluster-announce-bus-port 16379
volumes:
- valkey_c3_data:/data
omniq-valkey-cluster-init:
image: valkey/valkey:9-alpine
container_name: omniq-valkey-cluster-init
depends_on:
- omniq-valkey-c1
- omniq-valkey-c2
- omniq-valkey-c3
restart: "no"
command:
- sh
- -lc
- |
set -eu
echo "waiting nodes..."
valkey-cli -h omniq-valkey-c1 -p 6379 ping
valkey-cli -h omniq-valkey-c2 -p 6379 ping
valkey-cli -h omniq-valkey-c3 -p 6379 ping
echo "creating cluster..."
valkey-cli --cluster create \
omniq-valkey-c1:6379 \
omniq-valkey-c2:6379 \
omniq-valkey-c3:6379 \
--cluster-replicas 0 \
--cluster-yes
echo "done."
omniq-python:
image: python:3.12-slim
container_name: omniq-python
working_dir: /app
environment:
PYTHONUNBUFFERED: "1"
volumes:
- ./:/app
depends_on:
- omniq-valkey-cluster-init
command: ["bash", "-lc", "tail -f /dev/null"]
volumes:
valkey_c1_data:
valkey_c2_data:
valkey_c3_data: