/
docker-compose.yml
80 lines (74 loc) · 1.64 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
# For use in development only.
services:
assets:
build:
context: .
dockerfile: ./docker/assets/Dockerfile
command: sh -c "yarn && yarn watch"
container_name: hines_assets
volumes:
- .:/code
# HACK: use node_modules from inside image instead of one on local machine
- /code/node_modules
db:
container_name: hines_db
env_file: .env
image: postgres:13
# Uncomment this and restart to log all queries to the console:
# command: ["postgres", "-c", "log_statement=all"]
ports:
- "5432:5432"
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data/
redis:
container_name: hines_redis
deploy:
resources:
limits:
# When set to 0 these will use as much as needed:
cpus: "0"
memory: "0"
image: "redis:7-bullseye"
restart: unless-stopped
stop_grace_period: "3s"
volumes:
- "redis:/data"
web:
build:
context: .
dockerfile: ./docker/web/Dockerfile
command: >
sh -c "
python manage.py migrate &&
python -Wd manage.py runserver 0.0.0.0:8000
"
container_name: hines_web
depends_on:
- db
- redis
env_file: .env
ports:
- "8000:8000"
restart: unless-stopped
volumes:
- .:/code
django-q:
build:
context: .
dockerfile: ./docker/web/Dockerfile
command: >
sh -c "
python manage.py qcluster
"
container_name: hines_djangoq
depends_on:
- redis
- web
env_file: .env
restart: unless-stopped
volumes:
- .:/code
volumes:
postgres_data:
redis: