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?
The Compose file is a YAML file defining services, networks and volumes. The default path for a Compose file is ./docker-compose.yml .
In Windows containers, configs are all mounted into C:\ProgramData\Docker\configs and symbolic links are created to the desired location, which defaults to C:\<config-name> . You can set the ownership ( uid and gid ) for the config, using either the numerical ID or the name of the user or group.
Docker-Compose: Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application's services (containers). Then, with a single command, you create and start all the services from your configuration.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With