-
Notifications
You must be signed in to change notification settings - Fork 19
/
docker-compose.yml
54 lines (50 loc) · 1.07 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
# nginx
nginx:
build: .
volumes:
- ${CONFIG_JSON}:/config.json
environment:
- "affinity:container!=nodes_nginx_*"
- "CONSUL_PORT_8500_TCP_ADDR=127.0.0.1"
- "LOG_LEVEL=warn"
- "CONSUL_KV_PREFIX=nginx"
net: "host"
restart: always
# example application
example1:
image: httpd:latest
environment:
SERVICE_NAME: "httpd"
SERVICE_TAGS: "0.0.1"
# example application2
example2:
image: httpd:latest
environment:
SERVICE_NAME: "httpd"
SERVICE_TAGS: "0.0.2"
# consul
consul:
command: -server -bootstrap -data-dir /data -ui-dir /ui
image: progrium/consul:latest
volumes:
- "/opt/consul:/data"
ports:
- "8300"
- "8400"
- "8500"
- "8600/udp"
environment:
CONSUL_SERVER_ADDRESS:
- "affinity:container!=nodes_consul_*"
net: "host"
restart: always
# service reigstrator
registrator:
command: -internal consul://127.0.0.1:8500
image: sttts/registrator:latest
volumes:
- "/var/run/docker.sock:/tmp/docker.sock"
environment:
- "affinity:container!=nodes_registrator_*"
net: "host"
restart: always