When to run this
Before a Compose stack first carries production traffic, and again whenever a service is added or its resources, probes, mounts or published ports change. Thirty minutes, most of it reading the rendered configuration.
How to run it
Run from the stack directory, with the same -f files, --profile
flags and .env the deploy uses. A checklist run against a different
file set than the deploy is a checklist run against a different stack.
STACK_DIR=/srv/stacks/platform
cd "$STACK_DIR"
export COMPOSE_FILE=compose.yaml:compose.prod.yaml
Nearly every item queries docker compose config --format json,
which is the rendered model: interpolation applied, overrides
merged, extends resolved. That is deliberate. The defect this
checklist most often finds is a value that is correct in the file you
read and different in the file Compose produced.
Two items need the daemon rather than the stack —
logging-bounded reads /etc/docker/daemon.json, and it needs
sudo on most hosts.
Reading the results
Most items print only what is wrong. config-renders,
no-unset-variables, images-digest-pinned, no-build-in-production,
restart-policy-set, healthcheck-defined, memory-limits-set,
no-privileged, no-docker-socket, secrets-not-in-environment,
production-volumes-external, ports-not-wildcard and
committed-and-tagged are all silent on a stack that passes. Any line
of output is a finding, and the line names the service.
Three items produce output for a human to judge rather than a
pass/fail: rendered-config-reviewed, healthcheck-is-meaningful and
networks-explicit. healthcheck-is-meaningful in particular cannot
be automated — the command prints each probe command, and somebody has
to decide whether that probe could fail for the reason that matters.
stack-starts-from-scratch has no command because nothing you can run
on the existing host will answer it. It needs a clean host, a docker compose up -d, and a functional test.
Evidence and sign-off
Attach the rendered docker compose config output and the git
revision to the change record. Together they are the complete
description of what was deployed, which is what the next incident
review will ask for.
- Rendered config attached: ______ Revision: ______________
- Clean-host bring-up date: ___________
- Operator: _________________ Date: ___________
- Reviewer: ________________ Date: ___________