ItsEcholot / ContainerNursery

Puts Docker Containers to sleep and wakes them back up when they're needed
MIT License
95 stars 6 forks source link

container health check #7

Closed everythingguy closed 3 years ago

everythingguy commented 3 years ago

I was having problems with the proxy if containers got turned off by something other than the proxy timeout. For example, if I manually turned off one of the containers the proxy was trying to control. When doing that the proxy would just say the host is unreachable. I added a health check for each container that the nursery is in charge of. If the health check fails the stop function is called to give the container the correct values for its boolean variables. This fixes the issue allowing the proxy to start the container once again if someone tries to access it after the manual shutdown.

ItsEcholot commented 3 years ago

This is a good idea but I don't like the implementation. I would rather not have more poll intervals that routinely check the status of containers.

I think PR #9 addresses the issue more elegantly. This way external starts & stops are also detected instantly instead of having a delay.