-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
195 lines (189 loc) · 4.8 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# created by Mike Czarny
version: '3'
networks:
app_network:
driver: bridge
ipam:
driver: default
config:
-
subnet: 172.60.0.0/24
services:
haproxy01:
container_name: haproxy01
hostname: haproxy01
depends_on:
- server01
- server02
- server03
image: ${HAPROXY_IMAGE}
networks:
app_network:
ipv4_address: ${HAPROXY1_IP}
aliases:
- frontend.socketz.gg
ports:
- "127.0.0.1:9000:9000"
haproxy02:
container_name: haproxy02
hostname: haproxy02
depends_on:
- server01
- server02
- server03
image: ${HAPROXY_IMAGE}
networks:
app_network:
ipv4_address: ${HAPROXY2_IP}
aliases:
- frontend.socketz.gg
ports:
- "127.0.0.1:9001:9000"
haproxy03:
container_name: haproxy03
hostname: haproxy03
depends_on:
- server01
- server02
- server03
image: ${HAPROXY_IMAGE}
networks:
app_network:
ipv4_address: ${HAPROXY3_IP}
aliases:
- frontend.socketz.gg
ports:
- "127.0.0.1:9002:9000"
server01:
container_name: server01
hostname: server01
image: ${SERVER_IMAGE}
stdin_open: true
tty: true
networks:
app_network:
ipv4_address: ${SERVER1_IP}
server02:
container_name: server02
hostname: server02
image: ${SERVER_IMAGE}
stdin_open: true
tty: true
networks:
app_network:
ipv4_address: ${SERVER2_IP}
server03:
container_name: server03
hostname: server03
image: ${SERVER_IMAGE}
stdin_open: true
tty: true
networks:
app_network:
ipv4_address: ${SERVER3_IP}
etcd01:
container_name: etcd01
hostname: etcd01
image: quay.io/coreos/etcd:v3.3.10
command: >
etcd -name etcd01
-advertise-client-urls http://${ETCD1_IP}:2379,http://${ETCD1_IP}:4001
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001
-initial-advertise-peer-urls http://${ETCD1_IP}:2380
-listen-peer-urls http://0.0.0.0:2380
-initial-cluster-token etcd-cluster-1
-initial-cluster etcd01=http://${ETCD1_IP}:2380,etcd02=http://${ETCD2_IP}:2380,etcd03=http://${ETCD3_IP}:2380
-initial-cluster-state new
networks:
app_network:
ipv4_address: ${ETCD1_IP}
aliases:
- etcd-cluster.socketz.gg
etcd02:
container_name: etcd02
hostname: etcd02
image: quay.io/coreos/etcd:v3.3.10
command: >
etcd -name etcd02
-advertise-client-urls http://${ETCD2_IP}:2379,http://${ETCD2_IP}:4001
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001
-initial-advertise-peer-urls http://${ETCD2_IP}:2380
-listen-peer-urls http://0.0.0.0:2380
-initial-cluster-token etcd-cluster-1
-initial-cluster etcd01=http://${ETCD1_IP}:2380,etcd02=http://${ETCD2_IP}:2380,etcd03=http://${ETCD3_IP}:2380
-initial-cluster-state new
networks:
app_network:
ipv4_address: ${ETCD2_IP}
aliases:
- etcd-cluster.socketz.gg
etcd03:
container_name: etcd03
hostname: etcd03
image: quay.io/coreos/etcd:v3.3.10
command: >
etcd -name etcd03
-advertise-client-urls http://${ETCD3_IP}:2379,http://${ETCD3_IP}:4001
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001
-initial-advertise-peer-urls http://${ETCD3_IP}:2380
-listen-peer-urls http://0.0.0.0:2380
-initial-cluster-token etcd-cluster-1
-initial-cluster etcd01=http://${ETCD1_IP}:2380,etcd02=http://${ETCD2_IP}:2380,etcd03=http://${ETCD3_IP}:2380
-initial-cluster-state new
networks:
app_network:
ipv4_address: ${ETCD3_IP}
aliases:
- etcd-cluster.socketz.gg
client01:
container_name: client01
hostname: client01
image: ${CLIENT_IMAGE}
stdin_open: true
tty: true
depends_on:
- server01
- server02
- server03
networks:
app_network:
ipv4_address: ${CLIENT1_IP}
client02:
container_name: client02
hostname: client02
image: ${CLIENT_IMAGE}
stdin_open: true
tty: true
depends_on:
- server01
- server02
- server03
networks:
app_network:
ipv4_address: ${CLIENT2_IP}
client03:
container_name: client03
hostname: client03
image: ${CLIENT_IMAGE}
stdin_open: true
tty: true
depends_on:
- server01
- server02
- server03
networks:
app_network:
ipv4_address: ${CLIENT3_IP}
client04:
container_name: client04
hostname: client04
image: ${CLIENT_IMAGE}
stdin_open: true
tty: true
depends_on:
- server01
- server02
- server03
networks:
app_network:
ipv4_address: ${CLIENT4_IP}