-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (63 loc) · 1.92 KB
/
docker-compose.yml
File metadata and controls
69 lines (63 loc) · 1.92 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
65
66
67
68
69
# 'docker-compose up' will run this.
version: '3' # 'docker-compose up' will run this.
# This section describes the various containers (services).
services:
pg:
image: postgres:10
healthcheck:
test: /usr/bin/pg_isready
interval: 30s
timeout: 10s
retries: 3
ports:
- 5432:5432
environment:
POSTGRES_DB: $POSTGRES_DB
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_USER: $POSTGRES_USER
networks:
- network
rabbitmq:
# There is a prebuilt RabbitMQ image; see
# https://hub.docker.com/_/rabbitmq/ for details.
# This variant is built on Alpine Linux (it's smaller) and includes
# the management UI.
image: rabbitmq:3-management-alpine
ports:
# HTTP management UI
- "15672:15672"
# The standard AMQP protocol port
- "5672:5672"
# networks:
# - rabbitm-network
#
# networks:
# rabbitm-network:
# driver: bridge
networks:
- network
consumer:
# If needed, Docker Compose will automatically run consumer/Dockerfile.
build: consumer
# Environment variables:
environment:
# The location of the RabbitMQ server. "amqp" is the protocol;
# "rabbitmq" is the hostname. Note that there is not a guarantee
# that the server will start first! Telling the pika client library
# to try multiple times gets around this ordering issue.
AMQP_URL: 'amqp://rabbitmq?connection_attempts=5&retry_delay=5'
# Again, run on the private network. Needed to see the "rabbitmq"
# magic Docker DNS name.
networks:
- network
publisher:
# Identical to the consumer.
build: publisher
environment:
AMQP_URL: 'amqp://rabbitmq?connection_attempts=5&retry_delay=5'
networks:
- network
networks:
# Declare our private network. We must declare one for the magic
# Docker DNS to work, but otherwise its default settings are fine.
network: { }