Zum Inhalt springen

Profiles & Templating

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

A profile is a compose-override template that knows how to wire a particular kind of stack into the edge network. When you register a project, MultiDocker picks a profile, substitutes a handful of placeholders, and writes the result to ~/.config/multi-docker/overrides/<name>.override.yml.

engine/detect.sh reads the image names and service names from your compose file and runs hardcoded checks. It prints a single profile name:

Profile Detected when Template
shopware-dockware any image matches dockware/* engine/profiles/shopware-dockware.yml
api-web-postgres services include nginx + api + web + postgres engine/profiles/api-web-postgres.yml
strapi-next services include frontend + backend + postgres and strapi appears in the file engine/profiles/strapi-next.yml
generic fallback synthesised inline by render.sh

Detection is a suggestion — you can always override it at registration time with mdocker init <path> --profile <name>.

Templates resolve from two layers, with the user layer winning:

1. ~/.config/multi-docker/profiles/<name>.yml ← persistent, GUI-editable (wins)
2. <runtime>/engine/profiles/<name>.yml ← bundled default, read-only
  • “Reset to standard” simply deletes the layer-1 file, so the bundled default takes over.
  • A custom profile exists only in layer 1 with no bundled pendant. It’s valid, but it’s never auto-detected — you pick it manually in the Add-Project flow.

engine/render.sh does a sed substitution (using # as the delimiter, so | in Traefik rules is safe). The token set is the single source of truth in lib/common.sh:

Placeholder Required Value
{{name}} yes project name, also the Traefik router/service prefix (must be unique)
{{hosts_rule}} yes the full Traefik rule — no routing without it
{{hostname}} no first non-wildcard hostname (e.g. for APP_URL)
{{hostname_api}} no first label + -api, rest unchanged: orbit.coding9.testorbit-api.coding9.test
{{base_domain}} no the primary base domain

A missing required placeholder makes a profile invalid (blocking save unless forced). Unknown {{…}} tokens become warnings.

{{hosts_rule}} expands multiple hostnames into a single rule, turning wildcards into Traefik HostRegexp matchers:

Host(`a.coding9.test`) || Host(`b.coding9.test`) || HostRegexp(`^[^.]+[.]wild[.]base$`)

Because an X.509 wildcard matches exactly one label, each wildcard host must also be added as a separate certificate SAN.

  1. Resolve hostnames (fallback: <name>.<primary-base-domain>).
  2. Compute the primary host and hosts_rule.
  3. Look up the template (user layer, then bundle; generic is synthesised unless overridden).
  4. sed-substitute the placeholders.
  5. Drop any service not present in the original compose.
  6. Resolve dangling depends_on / links for services switched off.
  7. Write <name>.override.yml.
  8. Write <name>.ports.yml from any registered port overrides.
  • shopware-dockware — targets proxy, shop, db (search optional). Adds HTTPS-backend Traefik labels, sets APP_URL, TRUSTED_PROXIES and MAILER_*mailcatcher:1025, disables the project’s local mailcatcher.
  • api-web-postgres — a reverse proxy in front of a split API and web service: routes nginx on port 80 and adds a second router for the MinIO console at minio.<hostname>. No env injection needed.
  • strapi-next — routes frontend (port 3000) on the main host; backend (Strapi, port 1337) gets two routers — the full API on {{hostname_api}}, and the admin panel mirrored on {{hostname}}/admin. Injects the matching NEXT_PUBLIC_STRAPI_URL / STRAPI_URL / CORS env.
  • generic — no template file; render.sh synthesises labels for any service exposing port 80/8080.

Bundled profiles are occasionally renamed. Projects registered under an older name keep working: when a project’s stored profile has no template under that name, multi-docker resolves it to its successor automatically. Nothing in your registry.json needs to change, and a template you saved yourself under the old name still takes precedence.

mdocker profile * exposes the templates for inspection and editing — and the macOS app has a dedicated profile editor with live validation and a diff-against-default view. See Writing & Customizing Profiles and the profile CLI reference.