MikaelElkiaer / dotnet-healthchecker

Small dotnet program to perform health checks in container images without curl or wget

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dotnet-healthchecker

Small .NET application to perform health checks in containers - without curl, wget, or other dependencies.

Usage

# Add the application
ADD https://github.com/mikaelelkiaer/dotnet-healthchecker/releases/download/main/healthchecker-net80-linux-x64 /usr/local/bin/healthchecker
# Make executable for all
RUN chmod +rx /usr/local/bin/healthchecker
# Configure health check using defaults
HEALTHCHECK CMD [ "healthchecker" ]

The health check above will default to a relative URI /healthz and a base URI:

  • http://localhost:8080 (.NET 8.0)
  • http://localhost:5000 (.NET <8.0)
# The health check can be configured using an absolute URI
HEALTHCHECK CMD [ "healthchecker", "http://localhost:5001/healthz" ]
# Or by setting a relative URI and utilizing an ASPNETCORE_ environment variable
ENV ASPNETCORE_HTTP_PORTS=5001
ENV ASPNETCORE_URLS=http://+:5001
HEALTHCHECK CMD [ "healthchecker", "/healthz" ]

Using a specific version (with checksum)

Under releases, specific versions can be found with separate install instructions. The instructions for specific releases also include a checksum as an added security measure.

About

Small dotnet program to perform health checks in container images without curl or wget


Languages

Language:Shell 48.5%Language:C# 36.4%Language:Dockerfile 15.1%