Run "python manage.py collectstatic" in Docker

This commit is contained in:
Joakim Hellsén 2024-03-18 02:00:10 +01:00
commit 1c42dd1651
No known key found for this signature in database
GPG key ID: D196AE66FEBE1DC9

View file

@ -6,6 +6,11 @@ set -e
# Debug
set -x
# 1. Collect static files
echo "Collect static files"
python manage.py collectstatic --noinput
echo "Collect static files done"
# 2. Apply database migrations
echo "Apply database migrations"
python manage.py migrate
@ -20,7 +25,7 @@ echo "Create cache table done"
num_cores=$(nproc --all)
workers=$((2 * num_cores + 1))
# 3. Start server
# 4. Start server
echo "Starting server with $workers workers"
gunicorn --workers=$workers --bind=0.0.0.0:8000 feedvault.wsgi:application --log-level=info --access-logfile=- --error-logfile=- --forwarded-allow-ips="172.*,192.*" --proxy-allow-from="172.*,192.*"
echo "Bye, love you"