Skip to content

common.yml: host/side profiles trigger spurious 'DOMAIN is not set' warnings #167

Description

@ineedjet

Summary

`apps/common.yml` declares `${DOMAIN}` inside the `x-labels`, `x-labels-http`, and `x-labels-api` YAML anchors, which are only actually used by the `main`, `main-http`, and `api` service profiles. The `host` and `side` profiles never reference these anchors and have no need for `DOMAIN` at all.

However, `docker compose` interpolates environment variable references across the entire merged YAML document during parsing, before resolving which service is actually being started - including unused top-level `x-` extension fields. So any app using the `host`/`side` profile (no Traefik routing, e.g. backend-only or host-networking apps) whose own `.env` doesn't set `DOMAIN` gets a spurious warning on every deploy:

time="..." level=warning msg="The \"DOMAIN\" variable is not set. Defaulting to a blank string."

Impact

Purely cosmetic - functionally harmless, all containers still start and report healthy. But it's noisy: confirmed on `dupmachine/flightdeck`, apps like `beszel-agent`, `pgbouncer`, and `home-assistant` (host/side profiles) each produce ~10-20 of these warnings per deploy, consistently across releases (verified identical counts across two separate release runs).

Suggested fix

Split `common.yml`'s anchors so `host`/`side` profiles don't share a document with the Traefik-label anchors that reference `${DOMAIN}`/`${APP_NAME}` - e.g. move the label anchors into a separate file only merged in for `main`/`main-http`/`api`, or otherwise structure the YAML so unused anchors aren't present in the same parse pass for profiles that don't need them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions