In most cases, applications do not consist of only one monolithic block, but rather of several application services that work together. When using Docker containers, each application service runs in its own container. When we want to run such a multi-service application, we can, of course, start all the participating containers with the well-known docker container run command, and we have done this in previous chapters. But this is inefficient at best. With the Docker Compose tool, we are given a way to define the application in a declarative way in a file that uses the YAML format.
Let's have a look at the content of a simple docker-compose.yml file:
version: "2.4"
services:
web:
image: fundamentalsofdocker/ch11-web:2.0
build: web
ports:
- 80:3000
db:
image: fundamentalsofdocker...