-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml-sample
63 lines (52 loc) · 1.3 KB
/
docker-compose.yml-sample
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
consul:
image: progrium/consul
# Replace with your Consul IP
command: -server -advertise 10.0.0.20 -bootstrap-expect 1
hostname: consul
ports:
- 8300:8300
- 8301:8301
- 8301:8301/udp
- 8302:8302
- 8302:8302/udp
- 8400:8400
- 8500:8500
# DNS on docker
- 172.17.42.1:53:53
- 172.17.42.1:53:53/udp
registrator:
image: progrium/registrator:latest
# central consul server
command: consul://10.0.0.20:8500
# or link to consul container
#command: consul://consul:8500
#links:
# - consul
volumes:
- /var/run/docker.sock:/tmp/docker.sock
hostname: registrator
restart: always
haproxy:
build: lb-haproxy
command: /usr/local/bin/consul-template -consul 10.0.0.20:8500 -wait 10s:120s -log-level info -template "/tmp/haproxy.ctmpl:/usr/local/etc/haproxy/haproxy.cfg:haproxy-restart"
ports:
- 8080:8080
- 8081:8081
volumes:
- ./lb-haproxy:/tmp
restart: always
nginx:
build: lb-nginx
command: /usr/local/bin/consul-template -consul 10.0.0.20:8500 -wait 5s:30s -log-level info -template "/tmp/nginx.ctmpl:/etc/nginx/conf.d/default.conf:nginx-reload"
ports:
- 8088:80
volumes:
- ./lb-nginx:/tmp
restart: always
app:
build: apinfo
ports:
- 4567
volumes:
- apinfo:/apinfo
#restart: always # better check the logs