From the course: Learning Docker Compose

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Multiple compose files

Multiple compose files - Docker Tutorial

From the course: Learning Docker Compose

Multiple compose files

- [Narrator] There are several instances where having multiple composed files is more valuable than another organization tool like service profiles. In general, a good use case for multiple composed files is any situation where there are two distinct sets of desired behavior, that will never coincide. A great example is having a separate composed override file for multiple environments like local staging and CI testing. That's because you will basically never have local and staging configurations running on the same host machine at the same time. On the other hand, having multiple composed files for different parts of a single system is not a good use case. That's because at some point, a developer may want to run the whole system at once. By default, Docker Compose will read two configuration files, one named docker-compose.yaml, the defaults, and one named docker-compose.override.yaml. The override file essentially inherits…

Contents