-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
69 lines (65 loc) · 1.32 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
services:
postgres:
container_name: postgres
image: postgres:latest
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
env_file:
- .env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $POSTGRES_DB -U $POSTGRES_USER"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app_network
web:
container_name: web
build:
context: .
dockerfile: ./docker/Dockerfile
ports:
- "8000:8000"
command: >
sh -c "
python src/manage.py migrate &&
python src/manage.py create_test_admin &&
python src/manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
networks:
- app_network
celery:
restart: always
container_name: celery
build:
context: .
dockerfile: ./docker/Dockerfile
command: sh -c "celery -A src.core worker -l INFO"
volumes:
- .:/code
env_file:
- .env
depends_on:
- web
- redis
networks:
- app_network
redis:
container_name: redis
image: redis
networks:
- app_network
networks:
app_network:
volumes:
postgres_data: