feat: add support for non-web healthchecks via app.json
This change converts existing CHECKS files into a healthchecks key that is understood by 'docker-container-healthchecker'. This tool supports a number of different types of container healthchecks - command, http, uptime - and can perform healthchecks against non-web processes. The use of the old CHECKS file is now deprecated, and will be removed in the next minor version. Users can use the 'docker-container-healthchecker' to convert existing CHECKS files to the new format automatically. Closes #2760
This commit is contained in:
@@ -1 +1 @@
|
||||
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker,/usr/bin/docker-image-labeler,/usr/bin/pack,/usr/bin/crontab
|
||||
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker,/usr/bin/docker-container-healthchecker,/usr/bin/docker-image-labeler,/usr/bin/pack,/usr/bin/crontab
|
||||
|
||||
20
docker/usr/local/bin/docker-container-healthchecker
Executable file
20
docker/usr/local/bin/docker-container-healthchecker
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $TRACE ]] && set -x
|
||||
|
||||
main() {
|
||||
declare desc="re-runs docker-container-healthchecker commands as sudo"
|
||||
local DOCKER_CONTAINER_HEALTHCHECKER_BIN=""
|
||||
if [[ -x "/usr/bin/docker-container-healthchecker" ]]; then
|
||||
DOCKER_CONTAINER_HEALTHCHECKER_BIN="/usr/bin/docker-container-healthchecker"
|
||||
fi
|
||||
|
||||
if [[ -z "$DOCKER_CONTAINER_HEALTHCHECKER_BIN" ]]; then
|
||||
echo "! No docker-container-healthchecker binary found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo -E "$DOCKER_CONTAINER_HEALTHCHECKER_BIN" "$@"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user