Try to shutdown container gracefully and faster
This commit is contained in:
parent
6000384c72
commit
775ec6424b
|
@ -7,5 +7,13 @@ poetry run python manage.py migrate
|
||||||
echo "Collect static files"
|
echo "Collect static files"
|
||||||
poetry run python manage.py collectstatic --clear --no-input
|
poetry run python manage.py collectstatic --clear --no-input
|
||||||
|
|
||||||
|
_term() {
|
||||||
|
echo "Caught SIGTERM signal!"
|
||||||
|
kill -SIGTERM "$gunicorn_pid"
|
||||||
|
}
|
||||||
|
trap _term SIGTERM
|
||||||
|
|
||||||
echo "Starting app"
|
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 -
|
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"
|
||||||
|
|
Loading…
Reference in New Issue