Containerize backend api and add erd generator via django-extensions

This commit is contained in:
Keannu Christian Bernasol 2024-11-24 12:25:57 +08:00
parent cf981c3c08
commit 9b78fdd9ae
7 changed files with 72 additions and 1 deletions

15
scripts/start.sh Normal file
View file

@ -0,0 +1,15 @@
#!/bin/bash
cd docmanager_backend/
python manage.py graph_models -o ../documentation/erd/app_models.png
python manage.py spectacular --color --file schema.yml
python manage.py migrate
if [ ! -d "static" ]; then
echo "Generating static files"
python manage.py collectstatic --noinput
fi
if [ "$DEBUG" = 'True' ]; then
python manage.py runserver "0.0.0.0:8000"
else
gunicorn --workers 8 --bind 0.0.0.0:8000 config.wsgi:application
fi