-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
120 lines (113 loc) · 2.77 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
version: "3.5"
networks:
rq-net:
external: true
name: rq-net
volumes:
rq-01-storage:
name: rq-01-storage
rq-02-storage:
name: rq-02-storage
rq-03-storage:
name: rq-03-storage
consul-storage:
name: consul-storage
services:
rabbitmq:
image: haproxy:2.8
hostname: rabbitmq
networks:
- rq-net
ports:
- "1936:1936" # UI
- "5672:5672" # AMQP
- "15672:15672" # UI
volumes:
- "./config/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg"
deploy:
mode: global
restart_policy:
condition: any
delay: 15s
consul:
image: hashicorp/consul:1.18
hostname: consul
command: [
"agent",
"-server",
"-bootstrap-expect=1",
"-retry-max=0",
"-retry-interval=30s",
"-datacenter=prod",
"-retry-join=consul",
"-client=0.0.0.0",
"-log-level=error",
"-log-rotate-max-files=-1",
# "-ui",
]
environment:
- CONSUL_BIND_INTERFACE=eth0
- CONSUL_CLIENT_INTERFACE=eth0
networks:
- rq-net
ports:
- "8400:8400"
- "8500:8500"
volumes:
- consul-storage:/consul/data
deploy:
mode: global
restart_policy:
condition: any
delay: 15s
rabbitmq-01:
image: <your-image>
hostname: rabbitmq-01
networks:
- rq-net
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
RABBITMQ_ERLANG_COOKIE: ${RABBITMQ_PASSWORD}
RABBITMQ_CONFIG_FILE: "/etc/rabbitmq/rabbitmq.conf"
volumes:
- "rq-01-storage:/var/lib/rabbitmq"
deploy:
replicas: 1
restart_policy:
condition: any
delay: 10s
rabbitmq-02:
image: <your-image>
hostname: rabbitmq-02
networks:
- rq-net
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
RABBITMQ_ERLANG_COOKIE: ${RABBITMQ_PASSWORD}
RABBITMQ_CONFIG_FILE: "/etc/rabbitmq/rabbitmq.conf"
volumes:
- "rq-02-storage:/var/lib/rabbitmq"
deploy:
replicas: 1
restart_policy:
condition: any
delay: 10s
rabbitmq-03:
image: <your-image>
hostname: rabbitmq-03
networks:
- rq-net
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
RABBITMQ_ERLANG_COOKIE: ${RABBITMQ_PASSWORD}
RABBITMQ_CONFIG_FILE: "/etc/rabbitmq/rabbitmq.conf"
volumes:
- "rq-03-storage:/var/lib/rabbitmq"
deploy:
replicas: 1
restart_policy:
condition: any
delay: 10s