TandoorRecipes/boot.sh

15 lines
466 B
Bash

#!/bin/sh
source venv/bin/activate
echo "Updating database"
while python manage.py migrate ; status=$? ; [ $status -eq 1 ]; do
echo "Migration failed due to database not being ready yet, retrying in 5 seconds..."
sleep 5
done
python manage.py collectstatic_js_reverse
python manage.py collectstatic --noinput
echo "Done"
chmod -R 755 /opt/recipes/mediafiles
exec gunicorn -b :8080 --access-logfile - --error-logfile - --log-level INFO recipes.wsgi