Skip to content

depends_on and healthchecks

Select an icon to see what it is.

Step 1 of 6

The healthcheck travels in the create call

The healthcheck in the file becomes Config.Healthcheck in POST /containers/create. The Test is a command to run inside the container, and times are in nanoseconds. Nothing runs until the container starts.

$ docker compose up -d
PrevNext

POST /v1.45/containers/create?name=shop-db-1

{
"Image": "postgres:17"
"Healthcheck": {
"Test": [
"CMD-SHELL"
"pg_isready -U postgres"
]
"Interval": 5000000000
"Timeout": 3000000000
"Retries": 5
}
}