-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
54 lines (49 loc) · 1.35 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
version: "3.2"
# list of containers to be run
services:
# rabbit_mq container uses the default rabbitmq image
# exposes the ports
# uses the specified volume
rabbit_mq:
# we use management image to get the
# plugin for web dashboard
image: rabbitmq:3.8-rc-management
container_name: rabbit_mq
ports:
- '5672:5672'
- '15672:15672'
volumes:
- rabbit_mqdata:/usr/share/rabbitmq/data
# produces container builds the producer image
# and produces message to the queue
producer:
build: producer
depends_on:
- rabbit_mq
environment:
AMQP_URL: 'amqp://rabbit_mq?connection_attempts=10&retry_delay=10'
volumes:
- ./producer:/usr/src/app/producer
# consumer container builds the consumer image
# and consumes messages from the queue
# we spawn 2 consumer containers to run parallely
# on the same queue
consumer1:
build: consumer
depends_on:
- rabbit_mq
environment:
AMQP_URL: 'amqp://rabbit_mq?connection_attempts=10&retry_delay=10'
volumes:
- ./consumer:/usr/src/app/consumer
consumer2:
build: consumer
depends_on:
- rabbit_mq
environment:
AMQP_URL: 'amqp://rabbit_mq?connection_attempts=10&retry_delay=10'
volumes:
- ./consumer:/usr/src/app/consumer
volumes:
rabbit_mqdata:
driver: local