https://github.com/dmptrluke/healthcheck
Lightweight healthcheck binary for distroless containers
https://github.com/dmptrluke/healthcheck
Last synced: 18 days ago
JSON representation
Lightweight healthcheck binary for distroless containers
- Host: GitHub
- URL: https://github.com/dmptrluke/healthcheck
- Owner: dmptrluke
- License: mit
- Created: 2026-03-31T09:15:28.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-31T09:20:24.000Z (3 months ago)
- Last Synced: 2026-03-31T11:33:21.234Z (3 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# healthcheck
Lightweight healthcheck binary for distroless Docker containers. ~2 MB static binary, no dependencies.
Two modes: HTTP endpoint checks and heartbeat file-age checks.
## Usage
Copy into your image from GHCR:
```dockerfile
COPY --from=ghcr.io/dmptrluke/healthcheck:1 /healthcheck /usr/local/bin/healthcheck
```
### HTTP check
Checks that an HTTP endpoint returns 200. Timeout is 4 seconds.
```yaml
healthcheck:
test: ["CMD", "healthcheck", "http", "127.0.0.1:8000", "/health/"]
interval: 60s
timeout: 5s
retries: 3
```
### File-age check
Reads a unix timestamp from a file and checks it's within the given number of seconds. Useful for worker processes that write a heartbeat file.
```yaml
healthcheck:
test: ["CMD", "healthcheck", "file-age", "/tmp/heartbeat", "120"]
interval: 30s
timeout: 5s
retries: 3
```
The heartbeat file should contain a unix timestamp (integer or float), e.g. Python's `time.time()` or `date +%s`.