How do you keep dev, CI and prod consistent?
BeginnerScenarioCI/CD and production rollouts
Answer
Situation read → "Works on my machine."
What I'd do → Same Dockerfile everywhere, same image promoted across environments, config via env, dev containers/Compose mirroring prod dependencies versions (postgres:17, not "whatever is on the laptop").
Why → Differences in environment are the root of most bugs.
Interview tip → Build once, promote by digest.
More on CI/CD and production rollouts
Design a GitHub Actions workflow that builds, scans and pushes an image.IntermediateZero-downtime deploy on a single Docker host.AdvancedDeploy via GitOps with image digests.IntermediateCanary a new image on a Swarm service.AdvancedDocker build is flaky in CI due to network errors on package installs.IntermediateRun database migrations in the deploy flow of containerized apps.Intermediate