The Docker Compose file format is very simple. YAML is a human-readable superset of JSON, and the Compose file specification uses descriptive attribute names. 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, but a service can be multiple instances of the same component running in different containers. 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:
A service is like a template to run a container from an image, with a known configuration. Using services, you can scale up components of the application—running multiple...