mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2025-09-18 05:29:37 +08:00
Move to uv/pyproject and overhaul project structure
This commit is contained in:
commit
fbb76f8196
26 changed files with 1981 additions and 0 deletions
27
.docker/start.sh
Normal file
27
.docker/start.sh
Normal file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
# Startup script for Docker container
|
||||
|
||||
echo "Running as: $RUN_TYPE"
|
||||
cd /app/src/
|
||||
if [ "$RUN_TYPE" = "api" ]; then
|
||||
echo "Generating OpenAPI schema file"
|
||||
python manage.py spectacular --color --file schema.yml
|
||||
|
||||
echo "Applying database migrations"
|
||||
python manage.py migrate
|
||||
|
||||
if [ ! -d "static" ]; then
|
||||
echo "Generating static files"
|
||||
python manage.py collectstatic --noinput
|
||||
fi
|
||||
|
||||
if [ "$BACKEND_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
|
||||
# TODO: Add in other runtypes (i.e. Celery Worker, Beat, Flower, etc)
|
||||
else
|
||||
echo "No RUN_TYPE value set. Exiting"
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue