23 lines
583 B
Bash
Executable File
23 lines
583 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
python manage.py migrate --noinput
|
|
|
|
# Load mineral data if the table is empty
|
|
python manage.py shell -c "
|
|
from dailystone.models import Mineral
|
|
if Mineral.objects.count() == 0:
|
|
from django.core.management import call_command
|
|
call_command('loaddata', 'minerals')
|
|
print(f'Loaded {Mineral.objects.count()} minerals')
|
|
else:
|
|
print(f'{Mineral.objects.count()} minerals already loaded')
|
|
"
|
|
|
|
python manage.py run_hltb_worker &
|
|
|
|
exec gunicorn kboris.wsgi:application \
|
|
--bind 0.0.0.0:8080 \
|
|
--workers 2 \
|
|
--access-logfile - \
|
|
--error-logfile -
|