Interview Prep/Docker/CI/CD and production rollouts

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.

All Docker questions Roadmap: Docker & containers

More on CI/CD and production rollouts