-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
52 lines (49 loc) · 1.49 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
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
ports:
- "5432:5432"
volumes:
- datavolume:/var/lib/postgresql/data
django:
extends:
file: docker-compose-common.yml
service: django
environment:
# Environment variables to configure PGSQL on startup.
# We don't care about commiting these creds to GitHub because they're only
# for our local development environment
- DJANGO_SETTINGS_MODULE=quecolectivo.settings
- POSTGRES_DATABASE=quecolectivo
- POSTGRES_USER=postgres
- POSTGRES_HOST=db
- PGPASSWORD=postgres
- DJANGO_SECRET_KEY=dev
ports:
- "8000:8000"
depends_on:
- db
links:
- db
volumes:
# Mount the app dir in the container so our changes to the app code
# are also changed in the container
- ./djangoserver/quecolectivo:/code/quecolectivo
command: bash wait-for-postgres.sh db gunicorn -w 8 --reload --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:
- 80:80
links:
- django
volumes:
datavolume: