files with the docker-compose command? Like so:
$ docker-compose -f docker-compose.yml -f docker-compose-prod.yml up --build
having different configurations where you dont want to repeat yourself too often
docker will merge the two files. Useful for env specific configs that are separate from a common template
It's useful where you have almost similar architecture in the dev and prod env.. And you want to just maintain a single file for the common config. And the stuff which is different can be added with supporting files like docker-compose-prod.yml
So it's a composition model? Like if we have the same service name in both files, at the end we'll have 1 service with values of both files under it?
Nope.. docker-compose will give out error while parsing the file.
Обсуждают сегодня