-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart-server-dev.sh
More file actions
executable file
·29 lines (22 loc) · 990 Bytes
/
start-server-dev.sh
File metadata and controls
executable file
·29 lines (22 loc) · 990 Bytes
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
#!/usr/bin/env bash
# start-server-dev.sh
# The compose.yaml file mounts our repository as a volume in the /app folder,
# which overwrites the static files collected during image build.
# So we need to collect the static files again at runtime.
echo "> Collecting static files"
(cd /app; python manage.py collectstatic --no-input --settings=backend.settings.base)
echo "> Making migrations"
(cd /app; python manage.py makemigrations)
echo "> Applying migrations"
(cd /app; python manage.py migrate)
echo "> Installing debugpy"
pip install debugpy
echo "> Creating superuser"
if [ -n "$DJANGO_SUPERUSER_USERNAME" ] && [ -n "$DJANGO_SUPERUSER_PASSWORD" ] ; then
(cd /app; python manage.py createsuperuser --no-input)
fi
echo "> Running Huey"
(cd /app; python manage.py run_huey &)
# Start server in development mode with django
echo "> Running server in development mode"
(cd /app; python -m debugpy --listen 0.0.0.0:5678 manage.py runserver 0.0.0.0:8000) & nginx -g "daemon off;"