Docker Compose Tip #93: The ambassador pattern for environment-specific dependencies
An app connects to Redis at localhost:6379 in every environment, but Redis never actually lives at the same place twice: a local container in dev, a managed instance in staging, a different managed instance in prod. Something has to resolve that difference, and the easiest place to put it is scattered if ENV == "prod" branches in the app’s own config. The ambassador pattern puts it in one disposable container instead. ...