The Docker Compose file format is very simple. YAML is a human-readable markup language, and the Compose file specification captures your application configuration, using the same option names that the Docker CLI uses. In the Compose file, you define the services, networks, and volumes that make up your application. Networks and volumes are the same concepts that you use with the Docker engine. Services are an abstraction over containers.
A container is a single instance of a component, which could be anything from a web app to a message handler. A service can be multiple instances of the same component running in different containers, all using the same Docker image and the same runtime options. You could have three containers in the service used for your web application and two containers in the service you use for a message handler...