liveBook · Manning

Docker Compose

As explained in Data Pipelines with Apache Airflow, Second Edition

Docker Compose is a tool for defining and managing multicontainer Docker applications using configuration files.

Docker Compose defines and manages multicontainer Docker applications with YAML. It assembles reproducible environments such as Airflow deployments and NYC transportation pipelines from coordinated services. section 2.3.2 section 13.1

A Compose configuration can coordinate:

  • Airflow services including the database, workers, scheduler, API server, DAG processor, and triggerer. section 2.3.2
  • Data-pipeline building blocks including REST APIs, file shares, PostgreSQL databases, MinIO object storage, Redis, and a Flask application. section 13.1
  • Base configuration files plus chapter-specific override files that add functionality. section 2.3.2

Start a multi-service environment

From a directory containing compose.yaml, run `docker compose up --build -d`. Compose builds and starts the configured containers; `docker ps` then lists their images, names, and running state. section 13.1 section 2.3.2

Listing 13.1 Running use-case building blocks in Docker containers
$ docker compose up -–build -d
[+] Running 27/27
 ✔ citibike_api-1                                Built
 ✔ citibike_db                                   Built
 ✔ nyc_transportation_api                        Built
 ✔ taxi_db                                       Built
 ✔ taxi_fileserver                               Built
 ✔ Container chapter13-taxi_db-1                 Created
 ✔ Container chapter13-citibike_db-1             Created
 ✔ Container chapter13-minio-1                   Created
 ✔ Container chapter13-postgres-1                Created
 ✔ Container chapter13-result_db-1               Created
 ✔ Container chapter13-redis-1                   Created
 ✔ Container chapter13-airflow-python-build-1    Created
 ✔ Container chapter13-nyc_transportation_api-1  Created
 ✔ Container chapter13-minio_init-1              Created
 ✔ Container chapter13-airflow-init-1            Created
 ✔ Container chapter13-airflow-scheduler-1       Created
 ✔ Container chapter13-airflow-triggerer-1       Created
 ✔ Container chapter13-airflow-apiserver-1       Created
 ✔ Container chapter13-airflow-dag-processor-1   Created
 ✔ Container chapter13-airflow-worker-1          Created
 ✔ Container chapter13-taxi_fileserver-1         Created
 ✔ Container chapter13-citibike_api-1            Created

Inspect the multi-container startup output for a concrete Compose deployment containing databases, APIs, storage, Airflow services, and a web application. section 13.1

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Explains YAML configuration, service composition, overrides, startup commands, exposed services, and container inspection, without detailing Compose internals.
Examples
Uses Airflow deployment commands and an NYC transportation pipeline with databases, APIs, object storage, file serving, and a web page.
What it assumes
Assumes Docker Engine or Docker Desktop and basic shell navigation while introducing service configuration through YAML.
What you can do after
Operate/configure Docker-based Airflow and data-pipeline environments, start their services, and inspect running containers.
How it connects
Connects Docker Compose with Docker containers, YAML, Airflow, PostgreSQL, Redis, MinIO, REST APIs, file shares, and Flask.

Also explained in

Compare how 15 books explain Docker Compose →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.