restart:before: this hook lists commands that will run before the unit is
restarted. Commands listed in this hook will run once per unit. For instance,
imagine there’s an app with two units and the tsuru.yaml file listed above.
The command python manage.py generate_local_file would run two times, once
per unit.

restart:after: this hook is like before-each, but runs after restarting a
unit.

build: this hook lists commands that will be run during deploy, when the
image is being generated.

You can declare a health check in your tsuru.yaml file. This health check will be
called during the deployment process and tsuru will make sure this health check is
passing before continuing with the deployment process.

If tsuru fails to run the health check successfully it will abort the deployment
before switching the router to point to the new units, so your application will
never be unresponsive. You can configure the maximum time to wait for the
application to respond with the docker:healthcheck:max-time config.

healthcheck:path: Which path to call in your application. This path will be
called for each unit. It is the only mandatory field, if it’s not set your
health check will be ignored.

healthcheck:method: The method used to make the http request. Defaults to
GET.

healthcheck:status: The expected response code for the request. Defaults to
200.

healthcheck:match: A regular expression to be matched against the request
body. If it’s not set the body won’t be read and only the status code will be
checked. This regular expression uses Go syntax and runs with . matching
\n (s flag).

healthcheck:allowed_failures: The number of allowed failures before that the
health check consider the application as unhealthy. Defaults to 0.

healthcheck:use_in_router: Whether this health check path should also be
registered in the router. Please, ensure that the check is consistent to
prevent units being disabled by the router. Defaults to false. When an app has
no explicit healthcheck or use_in_router is false a default healthcheck is configured.