2021-09-06 00:10:14 +07:00
|
|
|
#!/bin/bash
|
|
|
|
# startup script inside the container for tubearchivist
|
|
|
|
|
2023-02-01 16:05:29 +07:00
|
|
|
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
|
2023-01-28 08:37:58 +07:00
|
|
|
python manage.py ta_envcheck
|
|
|
|
python manage.py ta_connection
|
2023-02-02 12:43:02 +07:00
|
|
|
python manage.py ta_startup
|
2022-12-19 14:43:10 +07:00
|
|
|
|
2023-02-02 13:12:12 +07:00
|
|
|
# start all tasks
|
2021-09-06 00:10:14 +07:00
|
|
|
nginx &
|
2025-02-02 15:45:40 +07:00
|
|
|
celery -A task.celery worker \
|
2025-06-03 23:03:13 +07:00
|
|
|
--loglevel=$LOGLEVEL \
|
2025-02-02 15:45:40 +07:00
|
|
|
--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
|