-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
76 lines (71 loc) · 1.5 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
version: '3'
services:
postgres:
restart: always
image: postgres:latest
# see: https://stackoverflow.com/a/60369496/2290820
env_file: web/.env
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_DB=postgres
ports:
- "5432"
volumes:
- pgdata:/var/lib/postgresql/data/
redis:
restart: always
image: redis:latest
ports:
- "6379:6379"
volumes:
- redisdata:/data
celery:
build: web
container_name: celeryc
command: celery -A backend worker -B --loglevel=DEBUG
volumes:
- ./web:/app
env_file: web/.env
links:
- redis
backend:
container_name: webc
command: sh -c "/wait && sh pre_start.sh && gunicorn backend.wsgi:application --worker-class=gevent -b :8000 -w 2 -n backend"
restart: always
build:
context: web
args:
- IS_WAIT=1
deploy:
replicas: 1
restart_policy:
condition: any
expose:
- 8000
ports:
- 8000:8000
links:
- postgres
- redis
volumes:
- ./web:/app
hostname: portcast-web
env_file: web/.env
environment:
- WAIT_HOSTS=postgres:5432,redis:6379
- WAIT_HOSTS_TIMEOUT=300
- WAIT_SLEEP_INTERVAL=30
- WAIT_HOST_CONNECT_TIMEOUT=30
healthcheck:
interval: 1m30s
retries: 3
test:
- CMD
- curl
- -f
- http://localhost:8000/apihealth/?format=openapi-json
timeout: 10s
volumes:
django-api:
pgdata:
redisdata: