-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
103 lines (100 loc) · 2.56 KB
/
docker-compose.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
version: '3'
services:
zoo1:
image: zookeeper
restart: always
hostname: zoo1
ports:
- 2181:2181
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
zoo2:
image: zookeeper
restart: always
hostname: zoo2
ports:
- 2182:2181
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
zoo3:
image: zookeeper
restart: always
hostname: zoo3
ports:
- 2183:2181
environment:
ZOO_MY_ID: 3
ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
server:
build:
context: ./
dockerfile: server.Dockerfile
container_name: "server1"
environment:
- ZOOKEEPER_SERVERS=zoo1:2181,zoo2:2181,zoo3:2181
- SERVER_ADDRESS=0.0.0.0:50052
- SERVER_URL=http://server:50052
ports:
- "50052:50052"
server2:
build:
context: ./
dockerfile: server.Dockerfile
container_name: "server2"
environment:
- ZOOKEEPER_SERVERS=zoo1:2181,zoo2:2181,zoo3:2181
- SERVER_ADDRESS=0.0.0.0:50053
- SERVER_URL=http://server2:50053
ports:
- "50053:50053"
server3:
build:
context: ./
dockerfile: server.Dockerfile
container_name: "server3"
environment:
- ZOOKEEPER_SERVERS=zoo1:2181,zoo2:2181,zoo3:2181
- SERVER_ADDRESS=0.0.0.0:50054
- SERVER_URL=http://server3:50054
- LEADER_ELECTION_PATH=/latch-2
- SERVICE_REGISTRY_PATH=/services-2
ports:
- "50054:50054"
server4:
build:
context: ./
dockerfile: server.Dockerfile
container_name: "server4"
environment:
- ZOOKEEPER_SERVERS=zoo1:2181,zoo2:2181,zoo3:2181
- SERVER_ADDRESS=0.0.0.0:50055
- SERVER_URL=http://server4:50055
- LEADER_ELECTION_PATH=/latch-2
- SERVICE_REGISTRY_PATH=/services-2
ports:
- "50055:50055"
router:
build:
context: ./
dockerfile: router.Dockerfile
container_name: "router"
environment:
- ZOOKEEPER_SERVERS=zoo1:2181,zoo2:2181,zoo3:2181
- SERVER_ADDRESS=0.0.0.0:50051
- SERVICE_REGISTRY_PATHS=/services,/services-2
ports:
- "50051:50051"
envoy:
image: envoyproxy/envoy:v1.28.0
ports:
- "10000:10000"
- "9901:9901"
- "51051:51051"
volumes:
- ./server/envoy.yaml:/etc/envoy/envoy.yaml
- ./server/proto:/proto
volumes:
zookeeper_data:
zookeeper_datalog: