Docker & deployment
The repo publishes a multi-arch (linux/amd64, linux/arm64) distroless image to GitHub Container Registry on every push to main:
ghcr.io/zachbroad/dns-monitor:latestghcr.io/zachbroad/dns-monitor:<version> # semver tagsghcr.io/zachbroad/dns-monitor:sha-<short> # commit pinsMinimal run
Section titled “Minimal run”docker run --rm -p 8080:8080 ghcr.io/zachbroad/dns-monitor:latestThis uses the default config.yaml baked into the image. The SQLite database lives inside the container and is lost on exit.
With a custom config and persistent history
Section titled “With a custom config and persistent history”Create config.yaml on the host and mount it alongside a data volume:
interval: 30slisten: ":8080"db_path: "/data/dns-monitor.db"targets: - name: example-a host: example.com type: A expect: - 93.184.216.34docker run -d --name dns-monitor \ -p 8080:8080 \ -v "$PWD/config.yaml:/app/config.yaml:ro" \ -v dns-monitor-data:/data \ ghcr.io/zachbroad/dns-monitor:latestNote the two volumes:
config.yamlis mounted read-only at/app/config.yaml, overriding the bundled default.- A named volume
dns-monitor-datais mounted at/data, anddb_pathpoints inside it so history survives container restarts.
Docker Compose
Section titled “Docker Compose”services: dns-monitor: image: ghcr.io/zachbroad/dns-monitor:latest restart: unless-stopped ports: - "8080:8080" volumes: - ./config.yaml:/app/config.yaml:ro - dns-monitor-data:/data
volumes: dns-monitor-data:Image details
Section titled “Image details”- Base:
gcr.io/distroless/static-debian12:nonroot— no shell, no package manager. - User:
nonroot(uid 65532). - Binary: CGO disabled;
modernc.org/sqliteis pure Go. - Exposed port:
8080. - Volume:
/data.