As already mentioned, Docker Compose uses a YAML file, typically named dockercompose.yml, to define what your multi-container application should look like. The Docker Compose representation of the two-container application we launched in Chapter 4, Managing Containers, is as follows:
version: "3"
services:
redis:
image: redis:alpine
volumes:
- redis_data:/data
restart: always
mobycounter:
depends_on:
- redis
image: russmckendrick/moby-counter
ports:
- "8080:80"
restart: always
volumes:
redis_data:
Even without working through each of the lines in the file, it should be quite straightforward to follow along with what is going on. To launch our application, we simply change to the folder that contains your docker-compose.yml file and run the following:
$ docker-compose up...