-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
105 lines (98 loc) · 2.24 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
version: "3.7"
volumes:
db-data: {}
redis-data: {}
services:
postgres:
image: postgres
env_file: .env
volumes:
- db-data:/var/lib/postgresql/data
ports:
- "5432:5432"
django:
build:
context: .
dockerfile: ./docker/django/Dockerfile
env_file: .env
command: /start-django.sh
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_started
redis:
condition: service_healthy
# extra_hosts:
# - "host.docker.internal:host-gateway"
# host-gateway is not working on my unix, so rely on default docker network
extra_hosts:
- "host.docker.internal:172.177.0.1"
stdin_open: true
tty: true
redis:
image: redis
volumes:
- redis-data:/data
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
# why we need healthcheck: https://github.com/redis/redis/issues/4624
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 1s
timeout: 3s
retries: 5
gui:
build:
context: .
dockerfile: ./docker/gui/Dockerfile
command: yarn serve
volumes:
- .:/code
ports:
- "8080:8080"
depends_on:
- django
extra_hosts:
- "host.docker.internal:172.177.0.1"
dramatiq-workers:
build:
context: .
dockerfile: ./docker/django/Dockerfile
env_file: .env
command: pipenv run python manage.py rundramatiq
volumes:
- .:/code
depends_on:
django:
condition: service_started
redis:
condition: service_healthy
extra_hosts:
- "host.docker.internal:172.177.0.1"
scheduler:
build:
context: .
dockerfile: ./docker/django/Dockerfile
env_file: .env
command: pipenv run python manage.py run_scheduler
volumes:
- .:/code
depends_on:
django:
condition: service_started
dramatiq-workers:
condition: service_started
redis:
condition: service_healthy
extra_hosts:
- "host.docker.internal:172.177.0.1"
# use fixed subnet so that we can bind host.docker.internal to host ip
networks:
default:
ipam:
config:
- subnet: 172.177.0.0/16