Compose Files
Examine a sample Docker Compose YAML file.
We'll cover the following...
We'll cover the following...
Compose uses YAML files to define microservices applications. We call them Compose files, and Compose expects you to name them compose.yaml or compose.yml. However, you can use the -f flag with the docker compose command to specify files with arbitrary names.
Docker Compose file for a multi-service application
Here is the Compose file we’ll be using. It’s called compose.yaml and is in the multi-container folder.
The first thing to note is that the file has three top-level keys with a block of code beneath each:
- services
- networks
- volumes
More top-level keys exist, but this app only uses the three in the list.
Let’s have a closer look at each.
Defining the web-fe service
The top-level services key is mandatory and is where you define application microservices. This app has two microservices called ...