-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-deploy.yaml
43 lines (42 loc) · 1.2 KB
/
docker-compose-deploy.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
services:
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ../data/source/staticfiles:/static
depends_on:
- backend
ports:
- 8080:80
- 8443:443
db:
image: postgres
environment:
- POSTGRES_DB=${SQL_DATABASE}
- POSTGRES_USER=${SQL_USER}
- POSTGRES_PASSWORD=${SQL_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data/
backend:
build:
context: ../data/source
volumes:
- type: bind
source: ../data/source
target: /code
- static_data:/code/staticfiles
environment:
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
- SECRET_KEY=${SECRET_KEY}
- DEBUG=${DEBUG}
- SQL_DATABASE=${SQL_DATABASE}
- SQL_USER=${SQL_USER}
- SQL_PASSWORD=${SQL_PASSWORD}
depends_on:
- db
ports:
- 8000:8000
command: bash -c "python manage.py collectstatic --noinput && python manage.py migrate && gunicorn --bind 0.0.0.0:8000 --timeout 300 --workers 4 aasp.wsgi"
volumes:
postgres_data:
static_data: