wowu / docker-rollout

🚀 Zero Downtime Deployment for Docker Compose
https://github.com/Wowu/docker-rollout
MIT License
2.37k stars 66 forks source link

zero downtime is a promise not held in reality: can you add a hook (so we can reload the proxy)? #23

Closed Morriz closed 7 months ago

Morriz commented 7 months ago

Your solution is incurring downtime as it ignores the downstream proxy, which needs to reload to register the rolled out container's new ip address. AND it needs to reload RIGHT AFTER the rollout moment. Unfortunately your script's duration is too long and in the mean time the proxy still forwards traffic to the old ip.

So my suggestion is to get a hook for us to call the reload of the proxy.

wowu commented 7 months ago

Thanks. You're right, and this problem is already tracked in #21, so I suggest moving the discussion there. I think we're go for the hook approach.

What the command in the hook would look like in your case? I need to know what parameters should be passed to the command in the hook, is container id enough? What proxy do you use?

Please respond in #21, I'll close this issue as a duplicate.

Morriz commented 7 months ago

Ah, great! I suggest to stay agnostic and let us provide a payload...we would want to specify something executable on the host like "docker compose exec proxy sh -c \'nginx -s reload'".

Morriz commented 7 months ago

which your code would then execute that is...