-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
105 lines (98 loc) · 2.08 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
services:
django:
build: ./django
container_name: django
env_file: .env
volumes:
- django_volume:/srcs
- ./blockchain/build:/blockchain/build
ports:
- 5000:443
networks:
- tran-net
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ganache:
condition: service_healthy
postgres:
image: postgres:16.4
container_name: postgres
env_file: .env
volumes:
- postgres_volume:/var/lib/postgresql
networks:
- tran-net
healthcheck:
test: pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
start_interval: 5s
redis:
image: redis:7.4.0
container_name: redis
networks:
- tran-net
healthcheck:
test: redis-cli PING
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
start_interval: 5s
ganache:
build:
context: ./blockchain
dockerfile: Dockerfile.ganache
container_name: ganache
command: ganache-cli -h 0.0.0.0 -p 8545 -i 5777
ports:
- "8545:8545"
networks:
- tran-net
healthcheck:
test: ["CMD", "curl", "-s", "http://localhost:8545"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
start_interval: 5s
restart: always
truffle:
build:
context: ./blockchain
dockerfile: Dockerfile.truffle
container_name: truffle
command: truffle migrate --network development
volumes:
- ./blockchain/build:/app/build
depends_on:
ganache:
condition: service_healthy
networks:
- tran-net
working_dir: /app
restart: on-failure
environment:
- HOST=ganache
- PORT=8545
- NETWORK_ID=5777
volumes:
django_volume:
driver: local
driver_opts:
o: bind
type: none
device: $PWD/django/srcs
postgres_volume:
driver: local
driver_opts:
o: bind
type: none
device: $PWD/postgres/dbdata
networks:
tran-net: