mirror of
https://github.com/dokku/dokku.git
synced 2026-02-23 19:50:34 +01:00
update docs to reflect default checks. rename DOKKU_DEFAULT_WAIT to DOKKU_DEFAULT_CHECKS_WAIT. refs #1323
This commit is contained in:
@@ -123,11 +123,11 @@ This is in particular useful, then you want to deploy to root domain, as
|
||||
|
||||
# Zero downtime deploy
|
||||
|
||||
Following a deploy Dokku's default behaviour is to switch new traffic over to the new container immediately.
|
||||
Following a deploy, dokku will now wait `DOKKU_DEFAULT_CHECKS_WAIT` seconds (default: `10`), and if the container is still running, then route traffic to the new container.
|
||||
|
||||
This can be problematic for applications that take some time to boot up and can lead to `502 Bad Gateway` errors.
|
||||
This can be problematic for applications whose boot up time can vary 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.
|
||||
Dokku provides a way to run a set of more precise 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.
|
||||
|
||||
@@ -137,7 +137,7 @@ A check is a relative URL and may be followed by expected content from the page,
|
||||
/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. This can be overridden in the CHECKS file by setting WAIT=nn.
|
||||
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. This can also be overridden in the CHECKS file by setting WAIT=nn.
|
||||
|
||||
Dokku will wait `DOKKU_WAIT_TO_RETIRE` seconds (default: `60`) before stopping the old container such that no existing connections to it are dropped.
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ if [[ ! -s "${TMPDIR}/CHECKS" ]] || [[ "$DOKKU_APP_CONTAINER_TYPE" != "web" ]];
|
||||
|
||||
# simple default check to see if the container stuck around
|
||||
# for more thorough checks, create a CHECKS file
|
||||
DOKKU_DEFAULT_WAIT=10
|
||||
dokku_log_info1 "Waiting for $DOKKU_DEFAULT_WAIT seconds ..."
|
||||
sleep $DOKKU_DEFAULT_WAIT
|
||||
DOKKU_DEFAULT_CHECKS_WAIT="${DOKKU_DEFAULT_CHECKS_WAIT:-10}"
|
||||
dokku_log_info1 "Waiting for $DOKKU_DEFAULT_CHECKS_WAIT seconds ..."
|
||||
sleep $DOKKU_DEFAULT_CHECKS_WAIT
|
||||
|
||||
! (is_container_running $DOKKU_APP_CONTAINER_ID) && dokku_log_fail "App container failed to start!!"
|
||||
dokku_log_info1 "Default container check successful!" && exit 0
|
||||
|
||||
Reference in New Issue
Block a user