Docker Compose is a scripting language designed to facilitate creating, running, and maintaining Docker containers. The main configuration file is docker-compose.yml. It is in YAML (YAML Ain't Markup Language) format, meaning key directives are followed by a colon (:). Sub-keys are indented directly underneath parent keys.
Here is the docker-compose.yml file used to bring up three mongod instances that simulate a replica set. This file is broken down into five main blocks: three to define each of the replica set members, a fourth to describe the virtual network, and a fifth block to describe volumes. At the top of the file, we place the version directive. This informs Docker Compose that this file follows directives compatible with version 3:
version: "3"
We then start with the definition for member1. In this definition, you will see the Docker container name, the hostname, the source image, port mappings, the...