In this section, we will take a look at some examples and break them to understand what we can do within the
docker-compose.yml file. Remember, earlier we discussed that in the YAML file, there needs to be either an
image section or a
build section. Let's take a look at an example using each. Then, we will look at an example using as many of the options available for the Docker Compose YAML file as possible.
Here is a breakdown of an example
docker-compose.yml file. We will break the contents into sections to help you understand each entry.
image section tells Docker Compose that you are going to define the configuration of your containers and what settings each will have:
haproxy:#container name image: tutum/haproxy ...