-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose.yml
82 lines (72 loc) · 1.85 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
version: "3.7"
x-haproxy-defaults: &haproxy-service
image: "haproxy:2.0-alpine"
volumes:
- "./haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro"
x-keepalived-defaults: &keepalived-service
image: "osixia/keepalived:2.0.19"
cap_add:
- NET_ADMIN
- NET_BROADCAST
- NET_RAW
environment:
KEEPALIVED_COMMAND_LINE_ARGUMENTS: >-
--log-detail
# -–dont-release-vrrp
# -–dont-release-ipvs
# --log-detail
# --dump-conf
networks:
ha-stack:
ipam:
config:
- subnet: 172.20.0.0/24
services:
runner:
image: "runner:local"
build:
context: .
networks:
- ha-stack
keepalived-a:
<<: *keepalived-service
network_mode: host
volumes:
- "./keepalived/proxy-a/keepalived.conf:/usr/local/etc/keepalived/keepalived.conf:ro"
- "./keepalived/notify.sh:/container/service/keepalived/assets/notify.custom.sh:ro"
keepalived-b:
<<: *keepalived-service
network_mode: host
volumes:
- "./keepalived/proxy-b/keepalived.conf:/usr/local/etc/keepalived/keepalived.conf:ro"
- "./keepalived/notify.sh:/container/service/keepalived/assets/notify.custom.sh:ro"
haproxy-a:
<<: *haproxy-service
networks:
ha-stack:
ipv4_address: 172.20.0.50
aliases:
- haproxy-a.ha.stack
haproxy-b:
<<: *haproxy-service
networks:
ha-stack:
ipv4_address: 172.20.0.60
aliases:
- haproxy-b.ha.stack
web-b:
image: "nginx:stable-alpine"
networks:
ha-stack:
aliases:
- web-b.ha.stack
volumes:
- "./web/server-b/index.html:/usr/share/nginx/html/index.html:ro"
web-a:
image: "nginx:stable-alpine"
networks:
ha-stack:
aliases:
- web-a.ha.stack
volumes:
- "./web/server-a/index.html:/usr/share/nginx/html/index.html:ro"