About this tool
Generate Dockerfile HEALTHCHECK and compose healthcheck blocks with tuned interval, timeout, retries and start period.
This generator writes a Dockerfile HEALTHCHECK instruction and the matching Compose healthcheck block — probe command, --interval, --timeout, --retries, --start-period and the newer --start-interval — using the real defaults from the Dockerfile reference (30s interval, 30s timeout, 3 retries, 0s start period). It also computes the worst-case time before Docker marks a failing container unhealthy, (retries − 1) × interval + timeout, so you can tune detection speed deliberately.
Open Docker Healthcheck Generator on AltFTool — it loads instantly in your browser.
Paste your code or data sample into the workspace.
Pick the format, conversion, or analysis you need.
Copy the polished result straight back into your project.
One set of inputs yields the Dockerfile instruction and the docker-compose healthcheck block with identical timing.
The worst-case unhealthy time (retries − 1) × interval + timeout is computed live as you tune values.
curl, busybox-wget and nc variants are generated with the right flags, plus a custom-command option for databases.
Per the Dockerfile reference: --interval=30s, --timeout=30s, --retries=3, --start-period=0s, and --start-interval=5s (the last requiring Docker Engine 25.0+). With these defaults a container that dies takes up to (3−1)×30+30 = 90 seconds to be marked unhealthy.
It takes retries consecutive probe failures, so from the first failing probe's start the worst case is (retries − 1) × interval + timeout. The defaults give 90 seconds; an interval of 5s, timeout of 3s and 3 retries cuts that to 13 seconds at the cost of more frequent probing.
It is a boot grace window: probe failures during start_period do not count toward the retry limit, but a single success immediately marks the container healthy and ends the grace period. Use it for apps with slow initialisation instead of raising retries, which would also slow failure detection later.
Many production images — distroless, alpine without extras, slim variants — do not include curl. Use the busybox wget probe (wget -q --tries=1 --spider) on alpine-based images, a language-native check like node -e with an http.get, or install curl explicitly in the final image stage.