Sign inSign up

thoschworks/dockerpinghc

By thoschworks

•Updated 7 days ago

Image
0

10K+

thoschworks/dockerpinghc repository overview

⁠dockerpinghc

Docker image that periodically calls a monitoring URL via HTTP GET.

Intended for use in multi-container Docker Compose projects as basic monitoring for the overall project: add the pinghc service to an existing compose.yml alongside your other services — as long as the entire stack is running, the ping is sent and the monitoring service reports the project as healthy.

⁠Source code

Source repository: Codeberg: thoschworks/dockerpinghc⁠

⁠Usage

cp sample.env .env

Edit .env and set your values:

PINGHC_URL=https://hc-ping.com/your-uuid-here
PINGHC_INTERVAL=60  # seconds

Start the container:

docker compose up -d

View logs:

docker compose logs -f

⁠Environment Variables

VariableRequiredDefaultDescription
PINGHC_URLyes—URL to call on each ping. Set to no to disable monitoring (container runs idle).
PINGHC_INTERVALno60Interval between pings in seconds

⁠Integration into a Multi-Container Project

The recommended way to add dockerpinghc to an existing Docker Compose project is via the pre-built image on Docker Hub. Images are available for AMD64 and ARM64.

⁠1. Add the service to your compose.yml
services:
  # ... your existing services ...

  pinghc:
    image: thoschworks/dockerpinghc:latest
    restart: unless-stopped
    environment:
      PINGHC_URL: ${PINGHC_URL}
      PINGHC_INTERVAL: ${PINGHC_INTERVAL}
⁠2. Set the environment variables

Add to your parent project's .env:

PINGHC_URL=https://hc-ping.com/your-uuid-here
PINGHC_INTERVAL=60  # seconds
⁠Alternative: Git submodule

If you prefer to build the image locally or pin to a specific commit, you can add dockerpinghc as a Git submodule instead.

git submodule add <repo-url> pinghc

Reference the local build in your compose.yml:

  pinghc:
    build: ./pinghc/build
    restart: unless-stopped
    environment:
      PINGHC_URL: ${PINGHC_URL}
      PINGHC_INTERVAL: ${PINGHC_INTERVAL}

Cloning a project that uses this submodule:

git clone --recurse-submodules <parent-project-url>

Or, if already cloned:

git submodule update --init

Updating the submodule:

git submodule update --remote pinghc
git add pinghc
git commit -m "Update pinghc submodule"

⁠Build

The image is built automatically by Docker Compose from the build/ directory:

docker compose build

⁠Versioning

Versions are derived from Git tags using git describe. To build a versioned image manually:

git tag v1.2.3
docker build -t dockerpinghc:v1.2.3 ./build

⁠Disclaimer

This project is created, maintained, and documented with the assistance of Claude Code.

Tag summary

Content type

Image

Digest

sha256:f169b7877…

Size

3.7 MB

Last updated

7 days ago

docker pull thoschworks/dockerpinghc