-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
42 lines (40 loc) · 1.22 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
version: "3.7"
services:
# Deploy the broker.
rabbitmq_server:
image: rabbitmq:3-management
# environment:
# - RABBITMQ_DEFAULT_USER=guest
# - RABBITMQ_DEFAULT_PASS=guest
ports:
# Expose the port for the worker to add/get tasks
- 5672:5672
# OPTIONAL: Expose the GUI port
- 15672:15672
# Deploy the worker
worker:
# Build using the worker Dockerfile
build:
context: .
dockerfile: Dockerfile
# Need to access the database
# OPTIONAL: If you worker needs to access your db that is deployed
# locally, then make the network mode as host.
network_mode: host
# Pass the rabbitmq_uri as env varible in order to
# connect to our service
environment:
# NOTE: Below we are using 127.0.0.1 because this container
# will run on the host network, thus it will have access to the
# host network.
# If it would not have run locally, we would have had to
# connect using the service name like following:
# amqp:rabbitmq_server:5672
rabbitmq_uri: amqp://127.0.0.1:15672
# Make it wait for rabbitmq deployment
depends_on:
- rabbitmq_server
redis:
image: redis:7-alpine
ports:
- '6379:6379'