-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
91 lines (69 loc) · 2.05 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
version: '2'
services:
# Consul (service discovery)
consul:
image: consul:v0.7.0
volumes:
- ./volumes/consul/config:/consul/config # You can edit consul.json to customise consul behaviour
network_mode: bridge
ports:
- 8400:8400
- 8500:8500
- 8600:8600/udp
entrypoint: consul agent -server -config-dir=/consul/config
labels:
- SERVICE_IGNORE # Tell Registrator to ignore this container
# Registrator (register containers as services in Consul)
registrator:
depends_on:
- consul
image: gliderlabs/registrator:v7
network_mode: bridge
links:
- consul:consul
volumes:
- /var/run/docker.sock:/tmp/docker.sock
# Thanks to the link above, the Consul container's IP can can resolved using the host name "consul"
entrypoint: /bin/registrator consul://consul:8500
fabio:
depends_on:
- consul
image: magiconair/fabio:1.3-go1.7.1
network_mode: bridge
ports:
- 5000:5000
- 5001:5001
links:
- consul:consul
volumes:
- ./volumes/fabio/fabio.properties:/etc/fabio/fabio.properties
# Our API end-point (v1).
api-v1:
depends_on:
- registrator
image: frd-api-v1
build: src/ApiV1
network_mode: bridge
ports:
- 6920:6920
# These labels (SERVICE_*) control how Registrator registers the container as a service in Consul
labels:
"SERVICE_NAME": "frd-api"
"SERVICE_TAGS": "api,v1,urlprefix-/api/v1"
"SERVICE_CHECK_HTTP": "/api/v1"
"SERVICE_CHECK_INTERVAL": "5s"
# Our API end-point (v2).
api-v2:
depends_on:
- registrator
image: frd-api-v2
build: src/ApiV2
network_mode: bridge
ports:
- 6921:6921
# These labels (SERVICE_*) control how Registrator registers the container as a service in Consul
labels:
"SERVICE_NAME": "frd-api"
"SERVICE_TAGS": "api,v2,urlprefix-/api/v2"
"SERVICE_CHECK_HTTP": "/api/v2"
"SERVICE_CHECK_INTERVAL": "5s"