Now that you have three containers ready to be used, you will learn how to create a docker-compose.yaml file. By using Docker Compose, you will be able to share a single YAML file and anyone will be able to run your application.
Docker-compose is part of the Docker tools suite and is an application that will take a YAML file to start all of your containers with one single command.
Using Compose is basically a three-step process:
Dockerfileso it can be reproduced anywhere.
docker-compose.ymlso they can be run together in an isolated environment.
docker-compose upand Compose starts and runs your applications.
Compose works in all environments: production, staging, development, and testing.