-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
75 lines (70 loc) · 1.65 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
version: '3.8'
services:
rabbitmq1:
image: rabbitmq:3-management
container_name: rabbitmq1
hostname: rabbitmq1
environment:
RABBITMQ_ERLANG_COOKIE: 'mysecretcookie'
RABBITMQ_NODENAME: 'rabbit@rabbitmq1'
ports:
- '15672:15672'
- '5672:5672'
volumes:
- rabbitmq1_data:/var/lib/rabbitmq
rabbitmq2:
image: rabbitmq:3-management
container_name: rabbitmq2
hostname: rabbitmq2
environment:
RABBITMQ_ERLANG_COOKIE: 'mysecretcookie'
RABBITMQ_NODENAME: 'rabbit@rabbitmq2'
RABBITMQ_USE_LONGNAME: 'true'
depends_on:
- rabbitmq1
links:
- rabbitmq1
ports:
- '15673:15672'
- '5673:5672'
volumes:
- rabbitmq2_data:/var/lib/rabbitmq
command: >
sh -c "
rabbitmq-server &
sleep 30 &&
rabbitmqctl stop_app &&
rabbitmqctl join_cluster rabbit@rabbitmq1 &&
rabbitmqctl start_app &&
tail -f /dev/null
"
rabbitmq3:
image: rabbitmq:3-management
container_name: rabbitmq3
hostname: rabbitmq3
environment:
RABBITMQ_ERLANG_COOKIE: 'mysecretcookie'
RABBITMQ_NODENAME: 'rabbit@rabbitmq3'
RABBITMQ_USE_LONGNAME: 'true'
depends_on:
- rabbitmq1
links:
- rabbitmq1
ports:
- '15674:15672'
- '5674:5672'
volumes:
- rabbitmq3_data:/var/lib/rabbitmq
command: >
sh -c "
rabbitmq-server &
sleep 30 &&
rabbitmqctl stop_app &&
rabbitmqctl join_cluster rabbit@rabbitmq1 &&
rabbitmqctl start_app &&
tail -f /dev/null
"
volumes:
rabbitmq1_data:
rabbitmq2_data:
rabbitmq3_data: