diff --git a/AUTHORS b/AUTHORS index 3b247d885..5efc5fb46 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,6 +4,7 @@ Alexander Alexander Beletsky Alexis Gavoty +Christian Joudrey Felipe Coury Jeff Lindsay Jose Diaz-Gonzalez diff --git a/docs/application-deployment.md b/docs/application-deployment.md index 53a978537..410c57e4a 100644 --- a/docs/application-deployment.md +++ b/docs/application-deployment.md @@ -81,6 +81,26 @@ This is in particular useful, then you want to deploy to root domain, as remote: -----> Application deployed: remote: http://dokku.me +# Zero downtime deploy + +Following a deploy Dokku's default behaviour is to switch new traffic over to the new container immediately. + +This can be problematic for applications that take some time to boot up and can lead to `502 Bad Gateway` errors. + +Dokku provides a way to run a set of checks against the new container, and only switch traffic over if all checks complete successfully. + +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 +``` + +Dokku will wait `DOKKU_CHECKS_WAIT` seconds (default: `5`) before running the checks to give server time to start. For shorter/longer wait, change the `DOKKU_CHECKS_WAIT` environment variable. + +Dokku will wait `DOKKU_WAIT_TO_RETIRE` seconds (default: `60`) before stopping the old container such that no existing connections to it are dropped. + # Removing a deployed app SSH onto the server, then execute: