The Whole Shebang: Compose Files
<p>You can read more about it from the <a href="https://docs.docker.com/compose/" rel="noopener ugc nofollow" target="_blank">official docs</a>, but to simplify, consider the following: you use <strong>Docker</strong> to manage containers, images, volumes, etc. When you do <code>docker run</code> you are basically executing a <strong>single</strong> container. If you want to start a second container, that somehow interacts with the first one, you’ll need to run <code>docker run</code> again, and take care of their volumes and networks separately, such that they can see and communicate with each other.</p>
<p>Docker Compose abstracts all of this, by providing a <strong>wrapper</strong> on top of Docker (yes! Docker Compose is simply a high-level CLI for Docker). In fact, you’ll see that most options are named in a very similar way to the ones available in the <code>docker run</code> subcommand.</p>
<p>With Docker Compose, you can <strong>declaratively</strong> define all of your containers (called <code>services</code> in the Docker Compose world…just because you can also use compose files in Swarm mode…but more on that in another article), volumes and networks, and their configurations, through YAML files called <strong>Compose Files</strong>. This way, whenever you need to manage your multi-container application, you only need to touch this compose file and then let Docker Compose take care of everything else.</p>
<p><a href="https://betterprogramming.pub/the-whole-shebang-compose-files-5b6f50dd196c"><strong>Learn More</strong></a></p>
<p> </p>