-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
90 lines (82 loc) · 3.09 KB
/
Copy pathcompose.yaml
File metadata and controls
90 lines (82 loc) · 3.09 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
# Three-node cluster: each tritium node fronts its own Valkey primary with one
# replica. Nodes are published on 8080-8082 for clients and the monitor.
#
# podman compose up --build # or: docker compose up --build
# go run ./cmd/tritium-monitor
# go run ./cmd/tritium-cli -addr localhost:8081 set hello world
# go run ./cmd/tritium-cli -addr localhost:8082 get hello
# Stores publish no host port, so they're reachable only on the compose
# network, never the internet; that's what makes the plaintext store link
# safe here without SECURE_STORE_TLS.
x-store: &store
image: docker.io/valkey/valkey:8-alpine
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 2s
timeout: 2s
retries: 15
x-node: &node
build: .
image: localhost/tritium:dev
services:
store1:
<<: *store
command: ["valkey-server", "--save", "", "--appendonly", "no"]
store1-replica:
<<: *store
command: ["valkey-server", "--save", "", "--appendonly", "no", "--replicaof", "store1", "6379"]
depends_on:
store1: { condition: service_healthy }
store2:
<<: *store
command: ["valkey-server", "--save", "", "--appendonly", "no"]
store2-replica:
<<: *store
command: ["valkey-server", "--save", "", "--appendonly", "no", "--replicaof", "store2", "6379"]
depends_on:
store2: { condition: service_healthy }
store3:
<<: *store
command: ["valkey-server", "--save", "", "--appendonly", "no"]
store3-replica:
<<: *store
command: ["valkey-server", "--save", "", "--appendonly", "no", "--replicaof", "store3", "6379"]
depends_on:
store3: { condition: service_healthy }
tritium1:
<<: *node
environment:
SECURE_STORE_ADDRESS: store1:6379
LISTEN_ADDRESS: ":8080"
ADVERTISE_ADDRESS: tritium1:8080
AUTH_PASSWORD: ${TRITIUM_PASSWORD:?put TRITIUM_PASSWORD and TRITIUM_PEER_PASSWORD in .env}
PEER_PASSWORD: ${TRITIUM_PEER_PASSWORD:?put TRITIUM_PASSWORD and TRITIUM_PEER_PASSWORD in .env}
ports: ["127.0.0.1:8080:8080"]
depends_on:
store1: { condition: service_healthy }
tritium2:
<<: *node
environment:
SECURE_STORE_ADDRESS: store2:6379
LISTEN_ADDRESS: ":8080"
ADVERTISE_ADDRESS: tritium2:8080
JOIN_ADDRESS: tritium1:8080
AUTH_PASSWORD: ${TRITIUM_PASSWORD:?put TRITIUM_PASSWORD and TRITIUM_PEER_PASSWORD in .env}
PEER_PASSWORD: ${TRITIUM_PEER_PASSWORD:?put TRITIUM_PASSWORD and TRITIUM_PEER_PASSWORD in .env}
ports: ["127.0.0.1:8081:8080"]
depends_on:
store2: { condition: service_healthy }
tritium1: { condition: service_started }
tritium3:
<<: *node
environment:
SECURE_STORE_ADDRESS: store3:6379
LISTEN_ADDRESS: ":8080"
ADVERTISE_ADDRESS: tritium3:8080
JOIN_ADDRESS: tritium1:8080
AUTH_PASSWORD: ${TRITIUM_PASSWORD:?put TRITIUM_PASSWORD and TRITIUM_PEER_PASSWORD in .env}
PEER_PASSWORD: ${TRITIUM_PEER_PASSWORD:?put TRITIUM_PASSWORD and TRITIUM_PEER_PASSWORD in .env}
ports: ["127.0.0.1:8082:8080"]
depends_on:
store3: { condition: service_healthy }
tritium1: { condition: service_started }