DockRoute
Configuration

Labels

The dockroute.* container labels — the whole contract between your services and your DNS.

Labels are how a container opts into DNS management. DockRoute reads them from every running container; anything without dockroute.enabled: "true" is ignored.

LabelRequiredDefaultDescription
dockroute.enabledyestrue opts the container in
dockroute.hostnameyesFQDN(s), comma-separated
dockroute.typenoAA, AAAA or CNAME
dockroute.targetnoDOCKROUTE_DEFAULT_TARGETRecord value (IP or CNAME target)
dockroute.ttlno300TTL in seconds
dockroute.tunnel.servicenoOrigin URL; publish via Cloudflare Tunnel instead of a plain record
dockroute.cloudflare.proxiednofalseProxy plain records through Cloudflare

Plain records

The minimal setup is two labels; the record target comes from DOCKROUTE_DEFAULT_TARGET when the label is omitted:

services:
  grafana:
    image: grafana/grafana
    labels:
      dockroute.enabled: "true"
      dockroute.hostname: "grafana.example.com"

Everything is overridable per container:

    labels:
      dockroute.enabled: "true"
      dockroute.hostname: "grafana.example.com,metrics.example.com"
      dockroute.type: "CNAME"
      dockroute.target: "host.example.com"
      dockroute.ttl: "120"

Tunnel publishing

dockroute.tunnel.service switches the container to Cloudflare Tunnel publishing and takes precedence over dockroute.type/dockroute.target:

    labels:
      dockroute.enabled: "true"
      dockroute.hostname: "whoami.example.com"
      dockroute.tunnel.service: "http://whoami:80"

The value is the origin URL — how cloudflared reaches the service inside your Docker network, usually http://<service-name>:<port>.

Behavior notes

  • Multiple hostnames on one container each get their own record.
  • Duplicate hostname + record type across containers: the first container wins; the duplicate is logged and skipped. Two containers can share a hostname with different types (one A, one AAAA), and a tunnel route always takes a hostname over a plain record.
  • Quoting matters in Compose: write label values as strings ("true", not true) so Docker does not coerce them.

On this page