Dynamic service redirections in Docker
As per https://12factor.net/config, configuration like this should be stored as environment variables.


  The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy to change between deploys without changing any code; unlike config files, there is little chance of them being checked into the code repo accidentally; and unlike custom config files, or other config mechanisms such as Java System Properties, they are a language- and OS-agnostic standard.


A service that you connect to is suitable to be defined as configuration, so the use of env vars is appropriate here.