docker-haproxy-certbot icon indicating copy to clipboard operation
docker-haproxy-certbot copied to clipboard

Container takes time to stop

Open popallo opened this issue 2 years ago • 2 comments

Hello everyone and thank you for sharing this excellent Dockerfile which is very useful to me.

I'm not an expert in Dockerfile (and Docker) but I was wondering about container downtime.

Indeed, on my side, the container using the built image takes more than 30 seconds to stop. So I think that a process is not stopping correctly and Docker is waiting for a timeout to take control and kill everything.

Anyone have an idea how to fix this? Or does it only affect my setup peharps? :)

I'm using the raw Dockerfile from this repo, I just modified a few things in the configuration files but nothing that could justify this long downtime.

I use docker-compose to launch the containers.

Thanks for the feedback.

popallo avatar Jan 10 '24 13:01 popallo

hello, it's strange, on my side haproxy takes 10 seconds to stop. Can you try using the image already built (ghcr.io/tomdess/docker-haproxy-certbot:master) and see if the behaviour changes?

tomdess avatar Jan 14 '24 19:01 tomdess

Hello, thank you for your feedback.

Even 10s is not "normal", as 10s is supposed to be the time Docker launches a SIGKILL on the container.

I have several servers, with different Docker containers and usually each container takes around 2s to shut down.

I tried to modify the Dockerfile in several ways, notably by not putting supervisord and therefore haproxy directly as the main process (PID 1 in the container) but that doesn't change anything.

I will do a more in-depth test as soon as I have a moment, with an "empty" haproxy configuration file, because currently I have quite a few backends running on it (around 50).

popallo avatar Jan 15 '24 08:01 popallo