-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
54 lines (49 loc) · 1.25 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
version: '3.7'
services:
# Servers on the consul cluster
server-1:
image: consul
command: consul agent -server -bootstrap-expect=3 -data-dir /tmp/consul -node=server-1
server-2:
image: consul
command: consul agent -server -bootstrap-expect=3 -data-dir /tmp/consul -retry-join=server-1 -node=server-2
server-3:
image: consul
command: consul agent -server -bootstrap-expect=3 -data-dir /tmp/consul -retry-join=server-1 -node=server-3
# Consul UI is exposed here.
consul-ui:
image: consul
command: consul agent -data-dir /tmp/consul -retry-join=server-1 -client 0.0.0.0 -ui -node=client-ui
ports:
- 8500:8500
hello_server:
image: server
depends_on:
- server-1
- server-2
- server-3
- consul-ui
- load-balancer
expose:
- 7777
environment:
- CONSUL_SERVER=server-1
- APP_NAME=hello_server
- APP_PORT=7777
- CONSUL_PORT=8500
- TAGS=hello_server,grpc_server
load-balancer:
image: lb
depends_on:
- server-1
- server-2
- server-3
- consul-ui
environment:
- CONSUL_SERVER=server-1
- APP_NAME=nginx
- APP_PORT=5000
- CONSUL_PORT=8500
- TAGS=nginx
ports:
- 5000:5000