|Andrey Arapov 0e2f678bfb updates||il y a 7 mois|
|Dockerfile||il y a 7 mois|
|README.md||il y a 7 mois|
|entrypoint.sh||il y a 7 mois|
This example shows how health check works in Docker Swarm and how it heals the service.
/usr/share/nginx/html/status file on every odd run which is then
picked by the health check that expects
alive status from the nginx running
in the container.
Then you can observe that running this container in Docker Engine alone will
not restart it. Hence we will run it as a service in the Docker Swarm which
will ensure the container gets restarted until it gets
docker build -t healthcheck-test .
Make sure you have recent Docker Engine installed.
docker swarm init
unhealthy mode as expected, health check
will pick this and Docker Swarm will restart that container which then will
start in a
docker ps |grep test1 docker service ls
docker service scale test1=0 docker service scale test1=1