Files
computer-playbook/roles/web-app-postmarks/templates/compose.yml.j2
kevinveenbirkenbach f45df04bf1 test(docker): forbid ARG defaults in every Dockerfile
A defaulted build argument answers a question the caller failed to answer. The
build then succeeds against a base image, version or path nobody chose, and the
mistake surfaces as wrong behaviour at runtime instead of a failed build.

web-app-bridgy-fed shows the cost: its metadata declared python 3.14 while the
Dockerfile default silently built against 3.12. Both look plausible, so nothing
pointed at the drift. It and web-app-postmarks now take the base image from the
same services declaration the rest of the role reads.

The lint walks every tracked Dockerfile, template variants and paths outside
roles/ included, which the existing ARG-scope check does not. A second
assertion fails when the scan finds no Dockerfile at all, so the rule cannot
pass vacuously if the walk ever breaks.

Touching the two Dockerfiles brought their pre-existing narration under the
comment lint; what carried substance moved into the file header.
2026-08-25 00:25:00 +02:00

21 lines
1.0 KiB
Django/Jinja

{% include 'roles/sys-svc-compose/templates/base.yml.j2' %}
{% set service_name = 'postmarks' %}
{{ service_name }}:
{{ lookup('template', 'roles/sys-svc-container/templates/build.yml.j2') | indent(4) }}
args:
NODE_BASE: "{{ lookup('config', application_id, 'services.postmarks.image') }}:{{ lookup('config', application_id, 'services.postmarks.version') }}"
POSTMARKS_REPO_URL: "{{ POSTMARKS_REPO_URL }}"
POSTMARKS_REF: "{{ POSTMARKS_REF }}"
CONTAINER_PORT: "{{ container_port | string }}"
{{ lookup('container_image', application_id, 'postmarks') }}
{{ lookup('compose_only', 'container_name', POSTMARKS_CONTAINER) }}
hostname: "{{ container_hostname }}"
{{ lookup('container_ports', ['postmarks', 'http', DOCKER_BIND_HOST]) | indent(4) }}
{{ lookup('container_healthcheck', service_name) | indent(4) }}
{% include 'roles/sys-svc-container/templates/base.yml.j2' %}
{{ lookup('container_networks') | indent(4) }}
{{ lookup('compose_volumes') }}
{{ lookup('compose_networks') }}