Skip to content

Readiness 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"
    readiness_probe:
      http_get:
        host: 127.0.0.1
        scheme: http
        path: "/"
        port: 80
      initial_delay_seconds: 5
      period_seconds: 10
      timeout_seconds: 5
      success_threshold: 1
      failure_threshold: 3

readiness_probe can be configured in to use one of the 2 mutually exclusive modes:

  1. exec: Will run a configured command and based on the exit code decide if the process is in a correct state. 0 indicates success. Any other value indicates failure.
  2. 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.