As of now, I have learned that the Docker Compose file consist of two root keys.

  1. version
  2. services

version is for us to specify the Docker Compose version.

services is for us to specify services we want to run in the form of Docker containers.

Example

From this app.

version: '3'
services:
  redis-server:
    image: redis
  node-app:
    # build will look for
    # the Dockerfile within
    # the current directory
    build: ./
    ports:
      - 4001:8081