Overview
The docker-compose.yml Tera template renders an invalid empty networks: key for the tracker service when no optional services (Caddy, MySQL, Prometheus) are enabled. This produces invalid YAML that Docker Compose rejects with:
services.tracker.networks must be a list
The bug means the entire deployment workflow (create → provision → configure → release → run) succeeds until the final run command, which fails when Docker Compose validates the generated file. There is no early validation that catches this invalid template output.
Specification
See detailed specification: docs/issues/382-docker-compose-template-empty-networks-key.md
Root Cause
In templates/docker-compose/docker-compose.yml.tera (lines 103-106), the tracker service renders networks: unconditionally:
networks:
{%- for network in tracker.networks %}
- {{ network }}
{%- endfor %}
When tracker.networks is empty (SQLite + no domains + no Prometheus), this produces invalid YAML: networks: with no list items.
The backup service correctly guards this with {%- if backup.networks | length > 0 %} — the tracker is missing this guard.
Reproduction
Any config with SQLite, no domains, and no Prometheus triggers this. Example: envs/json-output-test.json.
Steps: create environment → provision → configure → release → run → FAILS
Implementation Plan
Phase 1: Fix the Template
Phase 2: Add Test Coverage
Phase 3: Validate Rendered docker-compose.yml After Rendering
Phase 4: Documentation
Acceptance Criteria
Related
Overview
The docker-compose.yml Tera template renders an invalid empty
networks:key for the tracker service when no optional services (Caddy, MySQL, Prometheus) are enabled. This produces invalid YAML that Docker Compose rejects with:The bug means the entire deployment workflow (
create → provision → configure → release → run) succeeds until the finalruncommand, which fails when Docker Compose validates the generated file. There is no early validation that catches this invalid template output.Specification
See detailed specification: docs/issues/382-docker-compose-template-empty-networks-key.md
Root Cause
In
templates/docker-compose/docker-compose.yml.tera(lines 103-106), the tracker service rendersnetworks:unconditionally:When
tracker.networksis empty (SQLite + no domains + no Prometheus), this produces invalid YAML:networks:with no list items.The
backupservice correctly guards this with{%- if backup.networks | length > 0 %}— the tracker is missing this guard.Reproduction
Any config with SQLite, no domains, and no Prometheus triggers this. Example:
envs/json-output-test.json.Steps:
create environment→provision→configure→release→run→ FAILSImplementation Plan
Phase 1: Fix the Template
networks:block (matching backup pattern)Phase 2: Add Test Coverage
networks:keys in outputPhase 3: Validate Rendered docker-compose.yml After Rendering
docker compose config --quieton rendered output after template renderingconfiguretime with a clear error messagePhase 4: Documentation
Acceptance Criteria
./scripts/pre-commit.shruncommand succeeds with previously-failing configdocker compose config --quietconfiguretime (notruntime)Related
testcommand #380