multiversectl GitHub

Variables and labels

What a universe passes to the runtime, and the labels a compose file can use to ask for it.

What a universe passes

A compose file describes how it is reached with labels, read with docker compose config. The key names the host, the value is the container port:

services:
  app-dev:
    labels:
      multiverse.host.app: "4200"              # app-u3.<domain> -> port 4200
      multiverse.host.api: "8001"
      multiverse.host.api.entrypoint: devapi   # default: web
      multiverse.host.api.aliases: app,adm     # same service, other hostnames
      multiverse.publish: "true"               # keep my published ports

No labels needed in the common case. A service that exposes exactly one port is reached at the app's own name: app ui becomes ui-u3.<domain>. Ambiguity (several services with ports, or one service with several ports) is an error that names the exact label to add.

Order of precedence, per app: hosts: in the manifest, then multiverse.host.* labels, then the single exposed port.

Variables

Available to compose files and inline overlays:

VariableValue
UNIVERSE, UNIVERSE_SLUG, UNIVERSE_DIRThe number (3), the slug (u3), and the universe's directory.
MULTIVERSE_DOMAINThe wildcard domain in use.
COMPOSE_PROJECT_NAMEThe universe's runtime project.
<HOST>_HOSTOne per host key, e.g. APP_HOST is app-u3.<domain>.
<REPO>_DIROne per repository: that repository's checkout in the universe.
HOST_UID, HOST_GIDThe current user; a spec.env entry overrides them.