-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
62 lines (60 loc) · 1.39 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
version: "3.7"
services:
db:
image: mysql:5.7
container_name: mysqlDB
ports:
- "3306:3306"
restart: always
environment:
MYSQL_DATABASE: "epa-app-db"
MYSQL_ROOT_PASSWORD: "4kFDg@G@*G,#)Fa"
volumes:
- db_data:/var/lib/mysql/
app:
build: ./app
container_name: django-gunicorn
restart: always
env_file:
- app/epa.env
expose:
- 8000 # use expose insted of port to expose ports internal between containers and not to the host maschine
volumes:
- ./src/cdn_static_root:/src/cdn_static_root
command: "gunicorn --workers=2 --bind=0.0.0.0:8000 epa.wsgi:application"
depends_on:
- db
links:
- db:db
djangoq:
build: ./app
container_name: django-q-cluster
restart: always
env_file:
- app/epa.env
command: python manage.py qcluster
volumes:
- .:/code
expose:
- 8000
depends_on:
- db
- app
links:
- db:db
nginx:
image: nginx:1.17
container_name: ngx
restart: always
ports:
- "80:80"
volumes:
- ./nginx:/etc/nginx/conf.d
- ./src/cdn_static_root:/static
depends_on:
- app
volumes:
db_data:
# need to execute 'docker-compose run app python manage.py makemigrations'
# and 'docker-compose run app python manage.py migrate'
# Based on: https://github.com/wiamsuri/django-gunicorn-nginx-docker