unit icon indicating copy to clipboard operation
unit copied to clipboard

Container: How to terminate Nginx unit container from application code.

Open Dawoodkhorsandi opened this issue 2 years ago • 5 comments

Hey, I was wondering if there is a way to stop running the Nginx unit container from the application code.

In our scenario, we've some pre-conditions and the container should be down in case any conditions are not met.

Dawoodkhorsandi avatar Aug 20 '22 09:08 Dawoodkhorsandi

Hi @Dawoodkhorsandi If I understand you correctly you would like to stop the container? In this case you should talk to the docker control socket.

But I would do this from outside the container using something like a health-check or something similar.

tippexs avatar Aug 22 '22 08:08 tippexs

Hi guys I have the same problem and don't think form outside container is good enough. Adding health checks in production requires another dependency to kill or restart the container. It's going to mess up our production env

mm3906078 avatar Aug 24 '22 05:08 mm3906078

Sorry for my late response. I am still not sure if I understand you correctly. Can you try to describe a use case including some examples what do you need from Unit to make it work?

tippexs avatar Sep 15 '22 12:09 tippexs