When I pull the images from docker hub. Sometimes, I would like to run the images in a multi-container way. So I choose to use docker-compose. For example, I would run the zookeeper in replicated mode. I will new a file named docker-compose.yml, and run docker-compose up and wait for it to initialize completely.
My question is what is proper directory I should put docker-compose.yml file into?
I'm asking myself the same question: Where to put my docker-compose.yml
file?
I've decided to do it the following way:
docker-compose.yml
along with deployment scripts (Jenkins pipeline in my case).Why?
docker-compose.yml
describes a system (the composition of micro services) and how it is deployed.docker-compose.yml
(and Repo).However, of course there are reasonable exceptions. Assume you're deploying a customized Database along with a management tool (e.g. customized mariadb and adminer), then most things may live in one repository.