
“It works on my machine” is still a useful warning in 2026. The failure is often not in the application code but in environment drift: a different runtime, base image, configuration value, or backing-service version reaches production. Lock files help with dependencies, but they cannot pin every part of the runtime.
The twelve-factor app dev/prod parity principle is straightforward: keep development, staging, and production as similar as possible. Use the same type and version of database, queue, and cache wherever the application runs. Containers make that practical when their definitions are treated as deployable source rather than local scaffolding.
Start with one Compose definition and reuse it in development, CI, staging, and production. Put genuine environment differences in an overlay such as compose.production.yaml, merged with docker compose -f compose.yaml -f compose.production.yaml up. The base file can describe services and health checks; the overlay can adjust ports, logging, restart policy, and production-only settings. Pin image and base-image versions instead of using latest, so rebuilds do not silently change the software underneath the application.
Parity also needs tests. Testcontainers starts disposable databases, message brokers, and other dependencies in Docker containers, allowing CI to test against real services instead of relying only on mocks. For Kubernetes-based stacks, kind provides local clusters whose nodes run in Docker containers.
The deployment pipeline is another boundary. GitHub Actions environments can require reviewers, wait timers, deployment-branch rules, and environment-specific secrets before a job deploys or reads protected values.
The practical checklist is short: pin versions, reuse the container definition, separate environment values, test with real dependencies, and gate deployments through named environments. Parity does not mean identical hardware. It means reducing differences until failures can be reproduced before they become production incidents.
Related areas
Related What I Do
These What I Do pages are matched from the subject matter of this article, creating a cleaner path from educational content to implementation work.
Continue reading
Related articles
Based on shared categories first, then the strongest overlap in tags.

