-
-
Notifications
You must be signed in to change notification settings - Fork 53
Liveness Probe
Berger Eugene edited this page Jul 16, 2022
·
3 revisions
nginx:
command: "docker run -d --rm -p80:80 --name nginx_test nginx"
is_daemon: true
shutdown:
command: "docker stop nginx_test"
signal: 15
timeout_seconds: 5
liveness_probe:
exec:
command: "[ $(docker inspect -f '{{.State.Running}}' nginx_test) = 'true' ]"
initial_delay_seconds: 5
period_seconds: 2
timeout_seconds: 5
success_threshold: 1
failure_threshold: 3
liveness_probe
can be configured in to use one of the 2 mutually exclusive modes:
-
exec
: Will run a configuredcommand
and based on theexit code
decide if the process is in a correct state. 0 indicates success. Any other value indicates failure. -
http_get
: For an HTTP probe, the Process Compose sends an HTTP request to the specified path and port to perform the check. Response code 200 indicates success. Any other value indicates failure.-
host
: Host name to connect to. -
scheme
: Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP. -
path
: Path to access on the HTTP server. Defaults to /. -
port
: Number of the port to access on the process. Number must be in the range 1 to 65535.
-