mirror of
https://github.com/willfarrell/docker-autoheal.git
synced 2024-12-06 19:16:20 +01:00
Added AUTOHEAL_START_PERIOD to delay the first health check
This commit is contained in:
@@ -24,12 +24,13 @@ b) Set ENV `AUTOHEAL_CONTAINER_LABEL=all` to watch all running containers.
|
||||
|
||||
c) Set ENV `AUTOHEAL_CONTAINER_LABEL` to existing label name that has the value `true`.
|
||||
|
||||
Note: You must apply `HEALTHCHECK` to your docker images first. See https://docs.docker.com/engine/reference/builder/#/healthcheck for details.
|
||||
Note: You must apply `HEALTHCHECK` to your docker images first. See https://docs.docker.com/engine/reference/builder/#healthcheck for details.
|
||||
|
||||
## ENV Defaults
|
||||
```
|
||||
AUTOHEAL_CONTAINER_LABEL=autoheal
|
||||
AUTOHEAL_INTERVAL=5 # check every 5 seconds
|
||||
AUTOHEAL_START_PERIOD=0 # wait 0 second before first health check
|
||||
DOCKER_SOCK=/var/run/docker.sock
|
||||
```
|
||||
|
||||
|
||||
+3
-1
@@ -33,7 +33,9 @@ if [ "$1" = 'autoheal' ] && [ -e ${DOCKER_SOCK} ]; then
|
||||
}
|
||||
fi
|
||||
|
||||
echo "Monitoring containers for unhealthy status"
|
||||
echo "Monitoring containers for unhealthy status in ${AUTOHEAL_START_PERIOD} second(s)"
|
||||
sleep ${AUTOHEAL_START_PERIOD:=0}
|
||||
|
||||
while true; do
|
||||
sleep ${AUTOHEAL_INTERVAL:=5}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user