-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathdocker-compose.yml
60 lines (55 loc) · 1.72 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
version: '3'
services:
nginx:
build:
context: .
dockerfile: Dockerfile.nginx
volumes:
- .:/usr/src/reminiscence
ports:
- "80:80"
depends_on:
- web
web:
build: .
command: bash -c "while ! nc -w 1 -z db 5432; do sleep 0.1; done; python manage.py migrate; python manage.py createdefaultsu; python manage.py collectstatic --no-input; if [ ! -d '/usr/src/reminiscence/static/nltk_data' ]; then echo 'wait..downloading..nltk_data'; python manage.py nltkdownload; fi; gunicorn --max-requests 1000 --worker-class gthread --workers 4 --thread 10 --timeout 300 --bind 0.0.0.0:8000 reminiscence.wsgi"
env_file:
- ./docker.env
ports:
- "8000:8000"
volumes:
- ./static:/usr/src/reminiscence/static/
- ./archive:/usr/src/reminiscence/archive/
- ./logs:/usr/src/reminiscence/logs/
depends_on:
- db
worker:
build:
context: .
dockerfile: Dockerfile.worker
depends_on:
- db
- redis
- web
env_file:
- ./docker.env
volumes:
- ./static:/usr/src/reminiscence/static/
- ./archive:/usr/src/reminiscence/archive/
- ./logs:/usr/src/reminiscence/logs/
command: bash -c "celery -A reminiscence worker --loglevel=info -c 4"
db:
image: postgres:13
env_file:
- ./docker.env
# instead of using the env_file above for providing db-user-credentials
# you also could use the following insecure setting (not recommended)
# may come handy if you're experiencing db-connection problems after upgrade.
#environment:
# - POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./db:/var/lib/postgresql/data/
redis:
image: redis:7.2
ports:
- '6379:6379'