I find it quite common that I have multiple environments (for example test and prod) but the Docker containers that I wish to start are the same in both environments. The only d
See Update #2 below. This is now possible!
This is a much requested feature of Docker Compose. Unfortunately, the answer at the moment is that you can't. I'd recommend subscribing to these GitHub issues to get a better idea when and if this feature gets implemented:
Issue #495 is actually the most commented in their issue repository at the moment. You are definitely not alone in wanting to do this.
Update:
The latest issue tracking is at https://github.com/docker/compose/issues/1377.
Update #2:
This functionality has been merged and is available as of Docker Compose 1.5.0. See https://github.com/docker/compose/blob/129092b7/docs/yml.md#variable-substitution for usage information.