-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.local.yml
65 lines (57 loc) · 1.7 KB
/
docker-compose.local.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
version: '3'
# For static file changes, run:
# docker-compose run app ./manage.py collectstatic
# It is also possible to do this with fswatch:
# fswatch -o static | xargs -I{} docker-compose run app ./manage.py collectstatic --noinput
#
# Note that this is done outside the containers b/c getting fswatch and Django
# installed into the same container does not seem like a straightforward task.
#
# This fwatch approach is slow for ongoing development. For development of static
# files, use the docker-compose.yml file which runs in Django development mode.
# Use this docker-compose-local.yml file for verifying a more deployment-like setup.
# command: /usr/local/bin/gunicorn core.wsgi:application -w 2 -b :8000 --reload
services:
app:
restart: always
build: .
links:
- pg:pg
volumes:
- .:/usr/src/apps/cityhallmonitor
- web-static:/var/www/cityhallmonitor/static
env_file: .env
environment:
DEBUG: 'true'
PYTHONPATH: .
command: gunicorn --workers 3 --worker-tmp-dir /dev/shm --bind unix:/usr/src/apps/cityhallmonitor/mnt/cityhallmonitor.sock core.wsgi:application
depends_on:
- pg
nginx:
build: ./nginx/
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- .:/usr/src/apps/cityhallmonitor
- web-static:/var/www/cityhallmonitor/static
- ./nginx/logs:/var/log/nginx
links:
- app:app
depends_on:
- app
pg:
restart: always
image: postgres:11.6
environment:
PGDATABASE: cityhallmonitor
PGUSER: cityhallmonitor
PGPASSWORD: cityhallmonitor
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data/
volumes:
web-static:
pgdata: