-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yml
72 lines (66 loc) · 1.49 KB
/
docker-compose.yml
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
# docker build -t ysf/raftsample .
# then run: docker-compose up
# to connect, use IP from `docker network inspect bridge` and see the gateway IP
# don't use localhost, 127.0.0.1 or 0.0.0.0
version: '3.1'
services:
node_1:
image: ysf/raftsample
environment:
- SERVER_PORT=2221
- RAFT_NODE_ID="node1"
- RAFT_PORT=1111
- RAFT_VOL_DIR="node_data"
volumes:
- './node_1_data:/app/node_data'
ports:
- 1111:1111
- 2221:2221
node_2:
image: ysf/raftsample
environment:
- SERVER_PORT=2221
- RAFT_NODE_ID="node2"
- RAFT_PORT=1111
- RAFT_VOL_DIR="node_data"
volumes:
- './node_2_data:/app/node_data'
ports:
- 1112:1111
- 2222:2221
node_3:
image: ysf/raftsample
environment:
- SERVER_PORT=2221
- RAFT_NODE_ID="node3"
- RAFT_PORT=1111
- RAFT_VOL_DIR="node_data"
volumes:
- './node_3_data:/app/node_data'
ports:
- 1113:1111
- 2223:2221
node_4:
image: ysf/raftsample
environment:
- SERVER_PORT=2221
- RAFT_NODE_ID="node4"
- RAFT_PORT=1111
- RAFT_VOL_DIR="node_data"
volumes:
- './node_4_data:/app/node_data'
ports:
- 1114:1111
- 2224:2221
node_5:
image: ysf/raftsample
environment:
- SERVER_PORT=2221
- RAFT_NODE_ID="node5"
- RAFT_PORT=1111
- RAFT_VOL_DIR="node_data"
volumes:
- './node_5_data:/app/node_data'
ports:
- 1115:1111
- 2225:2221