35 lines
633 B
Bash
Raw Normal View History

2021-09-06 00:10:14 +07:00
#!/bin/bash
# startup script inside the container for tubearchivist
set -e
2021-10-28 15:49:58 +07:00
2025-06-03 23:03:13 +07:00
if [[ -n "$DJANGO_DEBUG" ]]; then
LOGLEVEL="DEBUG"
else
LOGLEVEL="INFO"
fi
2025-01-15 21:53:54 +07:00
# stop on pending manual migration
python manage.py ta_stop_on_error
2023-02-02 13:12:12 +07:00
# django setup
python manage.py migrate
2025-02-17 17:00:54 +07:00
python manage.py collectstatic --noinput -c
2023-02-02 13:12:12 +07:00
# ta setup
python manage.py ta_envcheck
python manage.py ta_connection
2023-02-02 12:43:02 +07:00
python manage.py ta_startup
2023-02-02 13:12:12 +07:00
# start all tasks
2021-09-06 00:10:14 +07:00
nginx &
celery -A task.celery worker \
2025-06-03 23:03:13 +07:00
--loglevel=$LOGLEVEL \
--concurrency 4 \
--max-tasks-per-child 5 \
--max-memory-per-child 150000 &
2025-06-03 23:03:13 +07:00
./beat_auto_spawn.sh &
2024-12-23 21:53:27 +07:00
python backend_start.py