Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.78 KB

README.md

File metadata and controls

49 lines (34 loc) · 1.78 KB

Mini Health

CI Docker Pulls

Simplest HTTP health check for scratch docker images

Usage

In your Dockerfile:

COPY --from=mymmrac/mini-health:latest /mini-health /mini-health
HEALTHCHECK CMD ["/mini-health", "https://example.org"]

Optionally copy ca-certificates if you don't have them already:

COPY --from=mymmrac/mini-health:latest \
    /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

Options

Usage mini-health [OPTIONS] URL

Option Description
-c int Smallest HTTP status code that is considered as an error (default: 400 bad request)
-d string Data passed as body of request
-e string Name of environment variable used as base URL
-m string HTTP method used for request (default: GET)
-q Quiet output (print only errors)

Example

HEALTHCHECK CMD ["/mini-health", "-e", "BASE_URL", "-c", "500", "/health"]

In this example GET request to URL $BASE_URL/health with no body will be made, HTTP status codes greater than 500 will be reported as errors.

Install manually

go install github.com/mymmrac/mini-health@latest