I've been playing around with Dokku on a server and using it to deploy MEAN apps. I really like it, but my one concern is that after a server reboot (or crash), Dokku doesn't restart the Mongo service. I manually have to go in and dokku mongodb:start
and then dokku MYAPP deploy
to get it to reconnect. Otherwise I get a bad gateway error.
Thanks for any tips! I'm pretty new to all of this.
This is a bug in the dokku-mongodb plugin. Dokku itself uses an Upstart script to start on boot. It is installed to /etc/init/dokku-redeploy.conf
and looks like this:
description "Dokku app redeploy service"
start on filesystem and started docker
script
sleep 2 # give docker some time
sudo -i -u dokku /usr/local/bin/dokku ps:restartall
end script
I'd suggest using something similar, perhaps:
description "Dokku MongoDB plugin redeploy service"
start on started dokku-redeploy
stop on runlevel [!12345]
setuid dokku
setgid dokku
exec /usr/local/bin/dokku mongodb:start
pre-stop exec /usr/local/bin/dokku mongodb:stop
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments