CIS 527



Lab 5.A - Orchestration

Container Orchestration

  • Deploy Containers at Scale
  • Multiple Copies, Multiple Nodes
  • Handle Routing, Restarting
  • Lab 2 - Automate!

Image Source: DevopsCube

Docker Compose

  • Isolated Environments
  • Preserve Data
  • Infrastructure as Code
  • Easily Apply Changes
  • Portability

Docker Compose File

Filename: docker-compose.yml

services:                   # top level item
  nginx:                    # name of service
    image: nginx:alpine     # image to use
    container_name: nginx1  # name of container
  mysql:
    image: mysql:latest
    container_name: mysql

Docker Compose Commands

  • docker compose up [-d]
  • docker compose down
  • docker compose start
  • docker compose run [service]

Composability

# docker-compose.yml
services:
  webserver:
    container_name: webserver
    extends:
      file: nginx.yml
      service: nginx
    # custom configuration here
# nginx.yml
services:
  nginx:
    image: nginx:alpine
    # default configuration here