-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (55 loc) · 1.36 KB
/
Copy pathdocker-compose.yml
File metadata and controls
59 lines (55 loc) · 1.36 KB
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
services:
db:
image: postgis/postgis
volumes:
- postgres-data:/var/lib/postgresql/data
- dbbackups:/backups
env_file:
- ./.env
ports:
- "${HOST_DB_PORT:-5434}:5432"
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mapsurvey"]
interval: 5s
timeout: 3s
retries: 5
web:
build: .
command: gunicorn --bind :8000 --workers ${WEB_CONCURRENCY:-2} --threads ${GUNICORN_THREADS:-4} --worker-class gthread --timeout ${GUNICORN_TIMEOUT:-60} mapsurvey.wsgi:application
ports:
- "${HOST_WEB_PORT:-8000}:8000"
env_file:
- ./.env
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c 'import urllib.request; urllib.request.urlopen(\"http://localhost:8000/robots.txt\")'"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
redis:
image: redis:7-alpine
ports:
- "${HOST_REDIS_PORT:-6379}:6379"
restart: on-failure
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
celery:
build: .
command: celery -A mapsurvey worker -l info
env_file:
- ./.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
dbbackups:
postgres-data: