From 9a7da8a9ec31c0fd43f2dae3f334901274447c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Mon, 11 Nov 2024 00:26:11 +0100 Subject: [PATCH] Start django cluster in container --- entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3ec572c..2a69d7b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,10 +10,14 @@ poetry run python manage.py collectstatic --clear --no-input _term() { echo "Caught SIGTERM signal!" kill -SIGTERM "$gunicorn_pid" + kill -SIGTERM "$django_q_pid" } trap _term SIGTERM +echo "Starting Django-Q cluster" +poetry run python manage.py qcluster & django_q_pid=$! + echo "Starting app" poetry run python -m gunicorn --bind 0.0.0.0:8001 timetracker.asgi:application -k uvicorn.workers.UvicornWorker --access-logfile - --error-logfile - & gunicorn_pid=$! -wait "$gunicorn_pid" +wait "$gunicorn_pid" "$django_q_pid"