-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.dev-init.yml
54 lines (50 loc) · 1.92 KB
/
docker-compose.dev-init.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
# runs a local version of Epilepsy12 for development on port 8000
# syncs changes in local code folder to the E12 container
# migrates the database
version: '3.11'
services:
# web container - runs the django app
web:
build: .
ports:
- 8005:8005
depends_on:
- db
volumes:
- .:/home/app/webapp
environment:
# these env vars are ONLY for development
- RCPCH_NHS_ORGANISATIONS_POSTGRES_DB_NAME=nhs_organisationsdb
- RCPCH_NHS_ORGANISATIONS_POSTGRES_DB_USER=nhs_organisationsuser
- RCPCH_NHS_ORGANISATIONS_POSTGRES_DB_PORT=5432
- RCPCH_NHS_ORGANISATIONS_POSTGRES_DB_PASSWORD=password
- RCPCH_NHS_ORGANISATIONS_POSTGRES_DB_HOST=db
- RCPCH_NHS_ORGANISATIONS_SECRET_KEY="mysecretkey"
- NHS_API_KEY=api-key
- DEBUG=True
- DJANGO_ALLOWED_HOSTS=0.0.0.0
- DJANGO_SUPERUSER_USERNAME=rcpch-nhs-organisations-dev-user
- DJANGO_SUPERUSER_PASSWORD=pw
- DJANGO_SUPERUSER_FIRST_NAME=dev
- DJANGO_SUPERUSER_SURNAME=dev
- DJANGO_SUPERUSER_EMAIL=rcpch-nhs-organisations-dev-user@rcpch.tech
- DJANGO_SUPERUSER_ROLE=1
command: >
sh -c "pip install --upgrade pip &&
pip install -r requirements/development-requirements.txt &&
python manage.py collectstatic --noinput &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py createsuperuser --noinput &&
echo 'DEV SETUP SCRIPT: Development superuser username: rcpch-nhs-organisations-dev-user' &&
echo 'DEV SETUP SCRIPT: Development superuser password: pw' &&
python manage.py runserver 0.0.0.0:8005"
# db container - runs postgres
db:
image: postgres:latest
# volumes:
# - ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_USER=nhs_organisationsuser
- POSTGRES_PASSWORD=password
- POSTGRES_DB=nhs_organisationsdb