Docker Compose is based on a docker-compose.yml file. This file defines all of the containers and settings you need to launch your set of clusters. The properties map onto how you use the
docker run commands, however, are now stored in source control and shared along with your code.
The format of the file is based on YAML (Yet Another Markup Language).
container_name: property: value - or options
Task: Defining First Container
In this scenario, we have a Node.js application which requires connecting to Redis. To start, we need to define our docker-compose.yml file to launch the Node.js application.
Given the format above, the file needs to name the container 'web' and set the build property to the current directory. We'll cover the other properties in future steps.
Copy the following yaml into the editor. This will define a container called web, which is based on the build of the current directory.
web: build: .