Merge pull request #1227 from feroda/main

Entrypoint adapted to be run multiple times and --noreload arg added to runserver to stop the container with CTRL-C
This commit is contained in:
Christopher Broderick 2024-12-22 10:30:17 +00:00 committed by GitHub
commit 43a71e89f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View File

@ -43,3 +43,4 @@ FROM python-run-stage AS backend
COPY . ${APP_HOME}
ENTRYPOINT ["/entrypoint"]
CMD ["python3", "demo/manage.py", "runserver", "--noreload", "0.0.0.0:8080"]

View File

@ -7,8 +7,12 @@ set -o nounset
pip3 install -e . --user || pip3 install -e .
pip3 install -e demo --user || pip3 install -e demo
python3 demo/manage.py migrate --noinput
DJANGO_SUPERUSER_PASSWORD=Test1234 python3 demo/manage.py createsuperuser --username admin --email helpdesk@example.com --noinput
# Install fixtures
python3 demo/manage.py loaddata emailtemplate.json
python3 demo/manage.py loaddata demo.json
python3 demo/manage.py runserver 0:8080
if [ ! -e "/app/demo/demodesk/db.sqlite3" ]; then
DJANGO_SUPERUSER_PASSWORD=Test1234 python3 demo/manage.py createsuperuser --username admin --email helpdesk@example.com --noinput
# Install fixtures
python3 demo/manage.py loaddata emailtemplate.json
python3 demo/manage.py loaddata demo.json
fi
exec "$@"