-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·68 lines (64 loc) · 1.78 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
version: "2.4"
services:
nomad-server:
build:
context: ./nomad
command: agent
environment:
NOMAD_RUN_ROOT: 1
NOMAD_LOCAL_CONFIG: >
{
"server": {
"enabled": true,
"server_join": {
"retry_join" : ["nomad1.service.dc1.consul"],
"retry_max": 3,
"retry_interval": "15s",
},
},
"client": {
"enabled": true,
"server_join": {
"retry_join": [ "nomad1.service.dc1.consul" ],
"retry_max": 3,
"retry_interval": "15s",
},
},
"consul": {
"server_service_name": "nomad2",
"client_service_name": "nomad-client2",
"address": "0.0.0.0:8500",
"auto_advertise": true,
"server_auto_join": true,
"client_auto_join": true,
"checks_use_advertise": true
},
"datacenter": "dc1",
"bind_addr": "192.168.0.173",
"log_level": "DEBUG",
"enable_debug": true
}
cap_add:
- SYS_ADMIN
volumes:
- /opt/nomad:/opt/nomad
- /var/run/docker.sock:/var/run/docker.sock
- /tmp:/tmp
network_mode: "host"
privileged: true
dns: 192.168.0.173
depends_on:
- consul-server
consul-server:
image: consul:latest
command: "consul agent -data-dir=/tmp/ -server -ui -node=server2 -client=0.0.0.0 -advertise=192.168.0.173 -join=192.168.0.172 -dns-port=53 -recursor=8.8.8.8"
network_mode: "host"
environment:
- "CONSUL_ALLOW_PRIVILEGED_PORTS=yes"
volumes:
- ./consul/config:/consul/config
my-registry:
image: registry:latest
ports:
- "50000:5000"
restart: on-failure