-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.dev.yml
49 lines (44 loc) · 1.47 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
# runs a local version of RCPCHCensusEngine for development on port 8001
# syncs changes in local code folder to the RCPCHCensusEngine container
# migrates the database and seeds the database
# YOU ONLY NEED TO USE THIS COMPOSE FILE THE FIRST TIME
version: '3.9'
services:
# web container - runs the django app
web:
build: .
ports:
- 8001:8001
volumes:
- .:/app
environment:
# these env vars are ONLY for development
- RCPCH_CENSUS_ENGINE_POSTGRES_DB_USER=rcpchCensususer
- RCPCH_CENSUS_ENGINE_POSTGRES_DB_PASSWORD=password
- RCPCH_CENSUS_ENGINE_POSTGRES_DB_NAME=rcpchCensusdb
- RCPCH_CENSUS_ENGINE_POSTGRES_DB_HOST=db
- RCPCH_CENSUS_ENGINE_POSTGRES_DB_PORT=5432
- RCPCH_CENSUS_ENGINE_SECRET_KEY=mysecretkey
- DEBUG=True
- DJANGO_ALLOWED_HOSTS=0.0.0.0
- DJANGO_CSRF_TRUSTED_ORIGINS=https://localhost,https://0.0.0.0
command: >
sh -c "python -u manage.py collectstatic --noinput &&
python manage.py runserver 0.0.0.0:8001"
# ensures that docker compose always displays log output
tty: true
stdin_open: true
# db container - runs postgres
db:
image: postgres:latest
volumes:
- "datadb:/var/lib/postgresql/data"
environment:
- POSTGRES_USER=rcpchCensususer
- POSTGRES_PASSWORD=password
- POSTGRES_DB=rcpchCensusdb
# ensures that docker compose always displays log output
tty: true
stdin_open: true
volumes:
datadb: