Closed algas closed 9 years ago
I think dokku-alt has that "seamless deployment" patch that makes it so it doesn't stop the old version before it starts the new version, so there's nothing you can do, except switch to vanilla Dokku (which I think incorporated the same patch recently?) or unbind/rebind the port when you redeploy, as you mentioned.
Basically, in dokku-alt (and contrary to how Dokku upstream worked when I wrote this), when you rebuild the app, the old version keeps running (until it's finished serving all incoming requests to it and the new version is ready) while the new version starts up. During that window, you can't have both versions bound to the port at the same time, so the attempt to start the new version fails.
(Side note, you can just do sudo dokku bind:create app-name 12345
rather than specify 12345 twice, as the value of CONTAINER_PORT is the default value of HOST_PORT.)
In general, in terms of maintenance of this plugin, for the record, I kind of agree with #2 that it's better to use a straight docker-options plugin than this specific one (although that still wouldn't help in this case).
Anyway, I'm focusing my efforts on Plushu instead of Dokku now. If I ever implement dokku-alt style failover deployment in Plushu, since it causes issues like this, it'll be optional (either as a config variable or as a separate plugin altogether).
If you were to write a patch that makes this compatible, you'd have to change the docker-opts hook to a post-deploy hook that restarts the app container with the bind option, which kind of defeats the entire purpose of the failover patch in the first place.
Thank you for your comment. I understand that it is not easy to write a patch for this problem. I'll try to use the docker-options plugin.
Closed by deprecation. If you want a platform that can bind app ports, use Plushu.
I was using this plugin on dokku-alt server. After I bound a port with an docker app container, I was not able to rebuild or redeploy without unbounding the port.
What am I supposed to do?