-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
82 lines (59 loc) · 1.63 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
77
78
79
80
81
82
version: "3"
services:
db:
image: postgres
container_name: example_db
env_file:
- ./django_core/.env
expose:
- 5432
volumes:
- ./dbs/postgres-data:/var/lib/postgresql/data
redis:
image: redis
container_name: example_redis
restart: always
expose:
- 6379
volumes:
- ./dbs/redis-data:/data/
backend:
image: template_django_core
container_name: template_django_core
build: ./django_core
env_file:
- ./django_core/.env
command: bash -c "
python3 manage.py makemigrations &&
python3 manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn -w 3 django_core.wsgi:application --bind 0.0.0.0:8000 --reload"
restart: always
expose:
- 8000
volumes:
- ./django_core:/var/www/apps/django_core
depends_on:
- db
- redis
celery:
image: template_django_core
container_name: example_celery
env_file:
- ./django_core/.env
command: celery -A django_core worker -B -l DEBUG -c 3
restart: always
volumes:
- ./django_core:/var/www/apps/django_core
depends_on:
- redis
nginx:
build: ./nginx
restart: always
ports:
- 1337:80
volumes:
- ./django_core/media:/var/www/media
- ./django_core/static:/var/www/static
depends_on:
- backend