From 044d7aa20da61538448d8f2c586add8b38959062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Sat, 8 Jul 2023 12:59:58 +0000 Subject: [PATCH] docker-swarm-usage reworked --- docs/docker-swarm-usage.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/docs/docker-swarm-usage.md b/docs/docker-swarm-usage.md index ae2c97e..218ae82 100644 --- a/docs/docker-swarm-usage.md +++ b/docs/docker-swarm-usage.md @@ -2,42 +2,46 @@ ## Healthcheck -The [Docker Image](../Dockerfile) includes a Healthcheck with the following options: +The [Docker Image](../Dockerfile) includes a health check with the following options: ``` --interval=30s ``` -> Specifies the time interval at which the health check should be performed. In this case, the health check will be performed every 30 seconds. - +> Specifies the time interval to run the health check. \ +> In this case, the health check is performed every 30 seconds.
``` --timeout=10s ``` -> Specifies the amount of time to wait for a response from the health check command. If the response does not arrive within 10 seconds, the health check will be considered a failure. - +> Specifies the amount of time to wait for a response from the \"healthcheck\" command. \ +> If the response does not arrive within 10 seconds, the health check fails.
``` --start-period=5s ``` -> Specifies the amount of time to wait before starting the health check process. In this case, the health check process will begin 5 seconds after the container is started. - +> Specifies the amount of time to wait before starting the health check process. \ +> In this case, the health check process will begin 5 seconds after the container is started.
``` --retries=3 ``` -> Specifies the number of times Docker should retry the health check before considering the container to be unhealthy. - +> Specifies the number of times Docker should retry the health check \ +> before considering the container to be unhealthy.
-The CMD instruction is used to define the command that will be run as part of the health check. -In this case, the command is `wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1`. This command will attempt to connect to `http://localhost:3000/` -and if it fails it will exit with a status code of `1`. If this command returns a status code other than `0`, the health check will be considered a failure. +The CMD instruction is used to define the command that will be run as part of the health check. \ +In this case, the command is `wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1`. \ +This command will attempt to connect to `http://localhost:3000/` \ +and if it fails it will exit with a status code of `1`. \ +If this command returns a status code other than `0`, the health check fails. -Overall, this HEALTHCHECK instruction is defining a health check process that will run every 30 seconds, wait up to 10 seconds for a response, -begin 5 seconds after the container is started, and retry up to 3 times. -The health check will consist of attempting to connect to http://localhost:3000/ and will consider the container to be unhealthy if it is unable to connect. +Overall, this HEALTHCHECK instruction is defining a health check process \ +that runs every 30 seconds, and waits up to 10 seconds for a response, \ +begins 5 seconds after the container is started, and retries up to 3 times. \ +The health check attempts to connect to http://localhost:3000/ \ +and will considers the container unhealthy if unable to connect.