Imagine you have a complex microservice. For local development, you need it connected to a message queue, a telemetry collector, and a database. But for your E2E testing, you need a slightly modified version (different env vars, an extra mock dependency, maybe a different port).

Most engineers solve this by maintaining two massive, almost-identical YAML files. It is a nightmare to sync changes.

Or they simply do this:

$ docker compose -f compose.yml -f e2e-compose.yml up --build -d

Enter fullscreen mode