steamcmd / api

Read-only API interface for steamcmd app_info
https://www.steamcmd.net
MIT License
59 stars 8 forks source link

Container doesn't shut down on SIGTERM #50

Closed Kakoen closed 9 months ago

Kakoen commented 9 months ago

The container doesn't listen to SIGTERM, meaning Docker [stop / restart] has to kill it forcefully after waiting 10 seconds (default timeout).

This can either be fixed by prepending the command with 'exec': CMD exec gunicorn main:app --max-requests 3000 --max-requests-jitter 150 --workers $WORKERS --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:$PORT

Or using exec form (which doesn't work because of the environent variables, you'd have to set the entrypoint to a small .sh script that does the same): CMD ["gunicorn", "main:app", ...]

See https://lucaspin.medium.com/where-is-my-sigterm-docker-ff7fd8aec757 for more info.

jonakoudijs commented 9 months ago

Hi Kakoen,

Good catch! I added exec to the CMD as you proposed. The change has been deployed in version v1.13.5. I tested the change on my own Kubernetes test cluster and it seems to have the intended effect.