Skip to content

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:latest
ghcr.io/zachbroad/dns-monitor:<version> # semver tags
ghcr.io/zachbroad/dns-monitor:sha-<short> # commit pins
Terminal window
docker run --rm -p 8080:8080 ghcr.io/zachbroad/dns-monitor:latest

This 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: 30s
listen: ":8080"
db_path: "/data/dns-monitor.db"
targets:
- name: example-a
host: example.com
type: A
expect:
- 93.184.216.34
Terminal window
docker 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:latest

Note the two volumes:

  • config.yaml is mounted read-only at /app/config.yaml, overriding the bundled default.
  • A named volume dns-monitor-data is mounted at /data, and db_path points inside it so history survives container restarts.
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:
  • Base: gcr.io/distroless/static-debian12:nonroot — no shell, no package manager.
  • User: nonroot (uid 65532).
  • Binary: CGO disabled; modernc.org/sqlite is pure Go.
  • Exposed port: 8080.
  • Volume: /data.