Created
July 29, 2024 21:03
-
-
Save Lauriy/fcc64f98beb570e386a6273cb41032d6 to your computer and use it in GitHub Desktop.
Docker entrypoint that runs either Django runserver, pytest, or uwsgi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
python manage.py migrate --noinput | |
case "$DJANGO_ENV" in | |
"development") | |
python manage.py loaddata rik_proovitöö/fixtures/superuser.json | |
python manage.py loaddata rik_proovitöö/fixtures/legal_entity.json | |
python manage.py loaddata rik_proovitöö/fixtures/equity.json | |
exec python manage.py runserver 0.0.0.0:8000 | |
;; | |
"test") | |
exec pytest | |
;; | |
"production") | |
python manage.py collectstatic --noinput | |
exec uwsgi --ini /home/docker/rik_proovitöö/uwsgi.ini | |
;; | |
*) | |
echo "DJANGO_ENV must be set to 'development', 'test', or 'production'" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment