-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
64 lines (57 loc) · 1.36 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
version: '3.9'
services:
web:
build:
context: .
dockerfile: Dockerfile
command: conda run --no-capture-output -n comedy-project-docker python manage.py runserver 0.0.0.0:8000
volumes:
- .:/audio-annonation
- ${MEDIA_ROOT}:/comedy/media
ports:
- "8000:8000"
environment:
- MEDIA_ROOT=/comedy/media
depends_on:
db:
condition: service_healthy
env_file:
- .env
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:13
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db-entrypoint.sh:/db-entrypoint.sh
ports:
- "5432:5432"
env_file:
- .env
environment:
- POSTGRES_PASSWORD=${DB_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$DB_USER -d $$DB_NAME"]
interval: 10s
timeout: 5s
retries: 5
entrypoint: ["./db-entrypoint.sh"]
migrate:
build:
context: .
dockerfile: Dockerfile
command: conda run --no-capture-output -n comedy-project-docker python manage.py migrate
volumes:
- .:/audio-annonation
- D:/anaconda-envs:/envs
depends_on:
db:
condition: service_healthy
env_file:
- .env
volumes:
postgres_data: