-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.full.yml
More file actions
64 lines (59 loc) · 1.43 KB
/
docker-compose.full.yml
File metadata and controls
64 lines (59 loc) · 1.43 KB
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
version: '3.8'
services:
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
hostname: rabbitmq
ports:
- "5672:5672" # AMQP protocol
- "15672:15672" # Management UI
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
volumes:
- rabbitmq_data:/var/lib/rabbitmq
restart: unless-stopped
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "ping"]
interval: 30s
timeout: 10s
retries: 5
networks:
- rabbitmq-net
producer:
build:
context: .
dockerfile: docker/Dockerfile.producer
container_name: rabbitmq-producer
depends_on:
rabbitmq:
condition: service_healthy
environment:
- RABBITMQ_HOST=rabbitmq
networks:
- rabbitmq-net
restart: "no" # Producer sends one message and exits - don't restart
# Remove profiles to run automatically with docker compose up
# profiles:
# - producer
consumer:
build:
context: .
dockerfile: docker/Dockerfile.consumer
container_name: rabbitmq-consumer
depends_on:
rabbitmq:
condition: service_healthy
environment:
- RABBITMQ_HOST=rabbitmq
networks:
- rabbitmq-net
restart: unless-stopped
# Remove profiles to run automatically with docker compose up
# profiles:
# - consumer
volumes:
rabbitmq_data:
networks:
rabbitmq-net:
driver: bridge