Robots Atlas>ROBOTS ATLAS
Deployment

Docker Compose

2014ActivePublished: 1 October 2026Updated: 1 October 2026Published
Key innovation
Reduced defining and running an entire multi-container application to a single declarative YAML file and one command (docker compose up), replacing hand-maintained scripts with many separate docker run invocations.
Category
Deployment
Abstraction level
System
Operation level
DeploymentServingSystem
Use cases
Local development environment for a whole app stack with one commandSelf-hosting AI stacks: model serving + vector database + API/gatewayReproducible environments for integration tests and CIPrototyping and demos of agentic and microservice applicationsRunning agentic platforms distributed as docker-composeSimple single-host deployments without a full orchestrator

How it works

A developer describes the application in a compose.yaml file using top-level elements: services (the computing components of the application), networks (how services communicate with each other), volumes (persistent data shared across services), and optionally configs and secrets. Each service points to an image to pull or a build context, plus ports, environment variables, dependencies (depends_on), healthchecks and mounted volumes. The docker compose up command reads the file, builds or pulls images, creates a shared network, starts the containers in the right order and wires them together using service names as DNS hosts. Companion commands (down, ps, logs, exec, build) cover the rest of the lifecycle. Compose V2 ignores the deprecated version element and interprets the file according to the Compose Specification.

Problem solved

Running a real application usually requires several cooperating containers (API, database, cache, queue, model serving) wired together over a network and persisting data in volumes. Doing this by hand with many docker run commands is tedious, non-reproducible and hard to version. Compose solves this by describing the whole stack as one file in the repository and recreating an identical environment with a single command.

Components

Compose file (compose.yaml)Declarative definition of the entire application stack

A single YAML file (compose.yaml by default, compose.yml as an alternative) in the working directory, describing services, networks, volumes and optionally configs and secrets. It is the source of truth for the stack and lives in the repository.

ServicesComputing components of the application

Each service is a container (or a set of them) run from a given image or build context, with ports, environment variables, dependencies and healthchecks. It is the main building block of a Compose file.

NetworksCommunication between services

Services communicate with each other through networks. Compose creates a default network for the project so services address each other by name as DNS hosts; additional isolated networks can also be defined.

VolumesPersistent, shared data

Services store and share persistent data in volumes that live independently of the container lifecycle. Typically used for databases, vector indexes or model caches.

Compose CLI (docker compose)Stack lifecycle management

A CLI plugin (Compose V2, written in Go) invoked as docker compose. Commands up/down/ps/logs/exec/build cover start, stop, status, logs and one-off commands. The older v1 was a separate Python tool invoked as docker-compose.

Implementation

Implementation pitfalls
Confusing docker-compose (v1) with docker compose (V2)Medium

Older materials use the docker-compose command (v1, Python), whereas current Compose V2 is a CLI plugin invoked as docker compose. Differences include V2 ignoring the version element.

Fix:Use Compose V2 (docker compose) and the current Compose Specification; do not rely on the version element.
depends_on does not wait for service readinessHigh

By default depends_on only enforces container start order; it does not wait until a service (e.g. a database) is actually ready to accept connections.

Fix:Define a healthcheck and use depends_on with condition: service_healthy; add retries in the application.
Not a replacement for a production orchestratorHigh

Compose typically manages a stack on a single host and does not provide multi-node scheduling, self-healing or cross-machine autoscaling โ€” those are jobs for Kubernetes or Swarm.

Fix:For production at scale use an orchestrator (Kubernetes); keep Compose for dev/local and simple deployments.
Port conflicts and bind-mount permission issuesMedium

Publishing the same host ports from several stacks causes conflicts, and host bind-mounts are a common source of permission and performance issues (especially on macOS/Windows).

Fix:Prefer named volumes over bind-mounts where possible, and separate ports or profiles across stacks.

Evolution

2013
First beta release (0.0.1)

First public beta of the tool (0.0.1) per Wikipedia; the project originates from the earlier Fig tool (the predecessor of Compose).

2014
Compose v1 (Python, docker-compose)
Inflection point

Compose v1 released in 2014, written in Python and invoked as docker-compose; the production-ready 1.0 became available on 16 October 2014.

2016
File format 2.x

Introduction of the 2.x Compose file format.

2017
File format 3.x

Introduction of the 3.x Compose file format.

2020
Compose V2 (Go, CLI plugin, Compose Specification)
Inflection point

Compose V2 announced in 2020: rewritten in Go, invoked as docker compose (CLI plugin). It ignores the version element and relies entirely on the open Compose Specification to interpret the file.

2025
Compose v5 (Go SDK)

Compose v5 released in 2025, functionally identical to Compose V2 but introducing an official Go SDK for programmatic integration.

Hyperparameters (configurable axes)

Service definitionsCritical

The set of container services making up the application; the primary configuration axis of a Compose file.

Image or build contextHigh

For each service: a prebuilt image to pull, or a local build context (Dockerfile).

Port mappingHigh

Publishing container ports on the host; a common source of conflicts when running multiple stacks.

Environment variablesHigh

Configuring services via environment variables and .env files (e.g. API keys, model endpoints).

Dependencies and readinessMedium

Service start order and readiness conditions; depends_on by itself only waits for start, not full readiness.

ProfilesLow

Conditionally enabling subsets of services (e.g. dev vs. full stack) within a single Compose file.