forked from thenewboston-blockchain/thenewboston-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
75 lines (69 loc) · 2.75 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
75
version: '3.9'
services:
db:
image: postgres:13.2-alpine
environment:
- POSTGRES_DB=thenewboston_node
- POSTGRES_USER=thenewboston
- POSTGRES_PASSWORD=thenewboston
volumes:
- postgresql-data:/var/lib/postgresql/data
reverse-proxy:
image: docker.pkg.github.com/thenewboston-developers/thenewboston-node/thenewboston-node-reverse-proxy:latest
ports:
- 8555:8555
volumes:
- type: volume
source: blockchain
target: /var/lib/blockchain_volume
volume:
nocopy: true
read_only: true
depends_on:
# we need to depend on node to avoid: nginx:
# [emerg] host not found in upstream "node" in /etc/nginx/conf.d/node.conf
- node
celery-broker:
# We need explicit hostname to avoid bloating of the RabbitMQ volume
hostname: celery-broker
# TODO(dmu) LOW: We do not expose any ports here for security reasons. To make it secure
# we would need a non-default user with password generated on the first
# start of RabbitMQ
# which is also propagated to `node` container (we can't generate password at
# image build time since it is not more secure than keeping the default
# password - because the generated password would be published with the image)
# But we may need to access RabbitMQ GUI management console for debugging
# purposes. Fix it to provide the access.
image: rabbitmq:3.9.7-management-alpine
# TODO(dmu) LOW: Make `celery` service DRY with `node` service
celery:
image: docker.pkg.github.com/thenewboston-developers/thenewboston-node/thenewboston-node:latest
environment:
- THENEWBOSTON_NODE_DATABASES={"default":{"HOST":"db"}}
- THENEWBOSTON_NODE_CELERY_BROKER_URL='amqp://guest:guest@celery-broker:5672//'
env_file: .env
command: poetry run celery -A thenewboston_node.project.celery worker --loglevel=INFO
depends_on:
- celery-broker
- db
volumes:
# We need to have /var/lib/blockchain_volume , so we can perform file move operations
- blockchain:/var/lib/blockchain_volume
node:
image: docker.pkg.github.com/thenewboston-developers/thenewboston-node/thenewboston-node:latest
environment:
- THENEWBOSTON_NODE_DATABASES={"default":{"HOST":"db"}}
- THENEWBOSTON_NODE_CELERY_BROKER_URL='amqp://guest:guest@celery-broker:5672//'
env_file: .env
command: ./run.sh
depends_on:
- db
- celery-broker
volumes:
# We need to have /var/lib/blockchain_volume , so we can perform file move operations
- blockchain:/var/lib/blockchain_volume
volumes:
postgresql-data:
driver: local
blockchain:
driver: local