-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose-dev.yml
74 lines (71 loc) · 2.24 KB
/
docker-compose-dev.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
66
67
68
69
70
71
72
73
74
services:
web:
build: .
restart: always
stdin_open: true
tty: true
expose:
# used by nginx: see proxy in sites-enabled
- "${DEV_PORT}"
# live test server port range
- "8081-8179"
links:
- postgres
- selenium
depends_on:
- postgres
volumes:
- ./infoscience_exports:/usr/src/app/infoscience_exports
- ./staticfiles:/usr/src/app/staticfiles
- ./coverage.xml:/usr/src/app/coverage.xml
- ./docker_volumes/logs:/var/log/django
env_file:
- .env
environment:
# the following vars need to be overridden because the directive env_file
# does not compute their value from the other variables
- SITE_URL=${SITE_URL}
- DATABASE_URL=${DATABASE_URL}
- DJANGO_ENV=dev
- PGPASSWORD=${POSTGRES_PASSWORD}
# set at least 2 workers, for django-debug-toolbar
command: gunicorn --max-requests 1 --reload -w 2 -b :${DEV_PORT} --chdir /usr/src/app/infoscience_exports wsgi:application
nginx:
build: ./nginx
ports:
# out:in = from [out] host, into [in] container
- "${DEV_PORT}:${DEV_PORT}"
volumes:
- ./nginx/sites-enabled/web.template:/etc/nginx/conf.d/web.template
- ./nginx/assets:/usr/share/nginx/html
- ./infoscience_exports:/usr/src/app/infoscience_exports
- ./staticfiles:/usr/src/app/staticfiles
- ./coverage.xml:/usr/src/app/coverage.xml
- ./docker_volumes/logs:/var/log/django
links:
# used in nginx/sites-enabled/web.conf
- web
environment:
- SERVER_HOST=${SERVER_HOST}
- SITE_PATH=${SITE_PATH}
- DEV_PORT=${DEV_PORT}
- DOLLAR=$$
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/web.template > /etc/nginx/conf.d/web.conf && nginx -g 'daemon off;'"
postgres:
image: postgres:12
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- ./docker_volumes/db_data:/var/lib/postgresql
ports:
- "25432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
selenium:
image: selenium/standalone-chrome-debug:3.11
ports:
- "4444:4444" # Selenium
- "${VNC_PORT}:5900" # VNC server, pass is "secret"