Zero down-time deploy and server checks

This change makes Dokku start up the new container, run a set of checks
against it, and only switch traffic over to the new containers if all
checks complete successfully. No requests are dropped during the switch
over.

To specify checks, add a CHECKS file to the root of your project
directory. This is a text file with one line per check. Empty lines and
lines starting with # are ignored.

A check is a relative URL and may be followed by expected content from
the page, for example:

  /about     Our Amazing Team

Even if you don’t use any checks, this change will prevent downtime
during switching from old to new container.

See: https://labnotes.org/zero-downtime-deploy-with-dokku/
This commit is contained in:
Assaf Arkin
2014-04-28 21:28:50 -07:00
parent 42fee25f2f
commit 00ec004871
3 changed files with 100 additions and 5 deletions

View File

@@ -84,6 +84,8 @@ EOF
echo "http://$hostname" > "$DOKKU_ROOT/$APP/URL"
fi
pluginhook nginx-pre-reload $APP
echo "-----> Running nginx-pre-reload"
pluginhook nginx-pre-reload $APP $PORT
echo " Reloading nginx"
sudo /etc/init.d/nginx reload > /dev/null
fi