generated from MrRezoo/django-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
89 lines (83 loc) · 1.97 KB
/
docker-compose.yaml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
name: goodreads
services:
app:
container_name: goodreads_app
image: goodreads_app:latest
build:
context: .
dockerfile: Dockerfile
command: >
bash -c "python manage.py migrate
&& python manage.py loaddata fixtures/user.json
&& python manage.py loaddata fixtures/book.json
&& python manage.py loaddata fixtures/bookmark.json
&& python manage.py loaddata fixtures/review.json
&& gunicorn --workers=3 --timeout=600 --bind=0.0.0.0:8000 core.wsgi:application"
depends_on:
- postgres
env_file:
- .compose/config.env
networks:
- goodreads
ports:
- "8000:8000"
restart: unless-stopped
volumes:
- app-data:/app
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8000/health/" ]
interval: 30s
timeout: 10s
retries: 5
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
postgres:
container_name: goodreads_postgres
image: postgres:16.2
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: goodreads
networks:
- goodreads
ports:
- "5433:5432"
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
celery:
container_name: goodreads_celery
image: goodreads_app:latest
build:
context: .
dockerfile: Dockerfile
command: bash -c "celery -A core.celery worker --beat -l info "
depends_on:
- postgres
- redis
env_file:
- .compose/config.env
networks:
- goodreads
restart: unless-stopped
redis:
container_name: goodreads_redis
image: redis:7.2
command: [ "redis-server", "--requirepass", "redis_password" ]
networks:
- goodreads
ports:
- "6379:6379"
restart: unless-stopped
volumes:
- redis-data:/data
networks:
goodreads:
driver: bridge
volumes:
postgres-data:
redis-data:
app-data: