create the second_run file inside the container

This commit is contained in:
Andreas Zweili 2020-07-04 12:12:42 +02:00
parent f692fce446
commit 74b7cfd3bd

5
run.sh
View File

@ -1,5 +1,5 @@
#!/bin/bash
if [ -f ./.second_run ]; then
if [ -f /var/cache/network_inventory/.second_run ]; then
sleep 2
python manage.py collectstatic --noinput
python manage.py makemigrations
@ -24,7 +24,8 @@ else
python manage.py loaddata nets
python manage.py loaddata softwares
python manage.py shell -c "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@example.com', 'password')"
touch .second_run
mkdir -p /var/cache/network_inventory
touch /var/cache/network_inventory/.second_run
fi
find . \( -name __pycache__ -o -name "*.pyc" \) -delete
gunicorn network_inventory.wsgi:application --reload --bind 0.0.0.0:8000 --workers 3