unit
unit copied to clipboard
Container: How to terminate Nginx unit container from application code.
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.
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.
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
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?