-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (60 loc) · 1.65 KB
/
Copy pathdocker-compose.yml
File metadata and controls
64 lines (60 loc) · 1.65 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
# 3-node ringcache on one host.
#
# docker compose up --build
# curl -sS http://127.0.0.1:8080/health
#
# network_mode: host so nodes share the host loopback and can replicate.
# A user-defined bridge looks more "cluster-like", but peer packets do not
# flow on some nested/CI Docker setups (this agent VM included: 100% loss
# between veths). Host mode is the honest single-machine demo.
#
# Docker Desktop (Mac/Windows) ignores host networking — use `make cluster`.
#
# Failure demo:
# ./scripts/failure-demo.sh --compose
x-common-env: &common-env
RINGCACHE_PEERS: "node-a=http://127.0.0.1:8080,node-b=http://127.0.0.1:8081,node-c=http://127.0.0.1:8082"
RINGCACHE_REPLICAS: "2"
RINGCACHE_CAPACITY: "10000"
RINGCACHE_VNODES: "150"
RINGCACHE_REPLICA_TIMEOUT_MS: "400"
services:
node-a:
build: .
network_mode: host
environment:
<<: *common-env
RINGCACHE_ID: node-a
RINGCACHE_LISTEN: "127.0.0.1:8080"
healthcheck:
test: ["CMD", "/ringcache", "-healthcheck"]
interval: 2s
timeout: 2s
retries: 15
start_period: 2s
node-b:
build: .
network_mode: host
environment:
<<: *common-env
RINGCACHE_ID: node-b
RINGCACHE_LISTEN: "127.0.0.1:8081"
healthcheck:
test: ["CMD", "/ringcache", "-healthcheck"]
interval: 2s
timeout: 2s
retries: 15
start_period: 2s
node-c:
build: .
network_mode: host
environment:
<<: *common-env
RINGCACHE_ID: node-c
RINGCACHE_LISTEN: "127.0.0.1:8082"
healthcheck:
test: ["CMD", "/ringcache", "-healthcheck"]
interval: 2s
timeout: 2s
retries: 15
start_period: 2s