-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-prod.yml
56 lines (53 loc) · 1.63 KB
/
docker-compose-prod.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
version: '2'
services:
db:
extends:
file: docker-compose-common.yml
service: db
# Publish the port so it's visible on the host, you can access the db directly
expose:
# Expose port 5432 so it's only visibile on the container, not the host
- "5432"
volumes:
- datavolume:/var/lib/postgresql/data
django:
extends:
file: docker-compose-common.yml
service: django
environment:
# Environment variables to configure pgsql on startup.
# Environment variables with only a key are resolved to their values on
# the machine Compose is running on. We do this to prevent ourselves
# from committing sensitive data to GitHub.
- DJANGO_SETTINGS_MODULE=quecolectivo.settings
- POSTGRES_DATABASE=quecolectivo
- POSTGRES_HOST=db
- POSTGRES_USER=postgres
- PGPASSWORD
- DJANGO_SECRET_KEY
volumes:
- /tmp:/tmp
expose:
# Expose port 8000 so it's only visibile on the container, not the host
- "8000"
depends_on:
- db
links:
- db
command: bash wait-for-postgres.sh db gunicorn --pythonpath '/code/quecolectivo/' quecolectivo.wsgi -b 0.0.0.0:8000
# command: bash wait-for-postgres.sh db python quecolectivo/manage.py runserver 0.0.0.0:8000
# Run Gunicorn to serve app requests and reload on change so we can see our
# changes to the app code
nginx:
extends:
file: docker-compose-common.yml
service: nginx
ports:
- "443:443"
- "80:80"
links:
- django
volumes:
- /etc/letsencrypt/archive/quecolectivo.duckdns.org:/etc/nginx/ssl/
volumes:
datavolume: