This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
82 lines (77 loc) · 1.91 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
x-deploy-policy: &x-deploy-policy
replicas: ${CONSUL_REPLICAS:-3} # <- Plz ignore this error
placement:
max_replicas_per_node: 1
constraints:
- node.role == manager
preferences:
- spread: node.labels.consul
update_config:
parallelism: 1
delay: 30s
order: start-first
failure_action: rollback
rollback_config:
parallelism: 1
delay: 30s
restart_policy:
condition: on-failure
delay: 30s
max_attempts: 3
window: 120s
x-default-logging: &x-default-logging
options:
max-size: "12m"
max-file: "5"
driver: json-file
configs:
00-default.hcl:
name: "consul_default-v${REVISION:-1.0}.hcl"
file: configs/00-default.hcl
config.hcl:
name: consul_config-v${REVISION:-1.0}.hcl
file: configs/config.hcl
services:
server:
image: hashicorp/consul:${CONSUL_VERSION:-latest}
command: agent
hostname: "consul-{{.Task.Slot}}-{{.Task.ID}}"
networks:
- consul_area_lan
ports:
# The HTTP API (TCP Only)
- 8500:8500
# The DNS server (TCP and UDP)
- 8600:8600/tcp
- 8600:8600/udp
# Server RPC address (TCP Only)
- 8300:8300
# The Serf LAN port (TCP and UDP)
- 8301:8301/tcp
- 8301:8301/udp
# The Serf WAN port (TCP and UDP)
- 8302:8302/tcp
- 8302:8302/udp
# The HTTPS API (TCP Only) (Disabled by default)
# - 8501:8501
# The gRPC API (Disabled by default)
# - 8502:8502
# The gRPC API with TLS connections (Disabled by default)
# - 8503:8503
configs:
- source: 00-default.hcl
target: /consul/config/00-default.hcl
- source: config.hcl
target: /consul/config/config.hcl
volumes:
- consul:/consul/data
deploy: *x-deploy-policy
logging: *x-default-logging
volumes:
consul:
name: consul
external: true
networks:
consul_area_lan:
name: consul_area_lan
external: true