created, id, keywords, links, modified, summary, tags, title
created
id
keywords
links
modified
summary
tags
title
2026-04-15T18:11:45+00:00
9ee96ac8-e1ff-4946-b08f-680be1d1b2bb
docker compose
compose.yaml
compose.yml
docker-compose
multi-container
services
networks
volumes
build
environment variables
depends_on
docker documentation
compose specification
configs
secrets
deploy
healthcheck
docker compose up
docker compose down
docker compose build
docker compose watch
2026-04-15T18:11:45+00:00
Comprehensive reference for Docker Compose covering the Compose file specification (compose.yaml), all top-level elements (services, networks, volumes, configs, secrets), key CLI commands, build specification, environment variable interpolation, and usage examples. Derived from official Docker documentation (docs.docker.com).
reference
docker
compose
containers
devops
orchestration
Docker Compose Reference
Docker Compose Reference
Overview
Docker Compose is a tool for defining and running multi-container applications. You use a YAML configuration file (compose.yaml) to configure your application's services, networks, and volumes. Then with a single command (docker compose up), you create and start all services from your configuration.
Compose works in all environments: production, staging, development, testing, and CI workflows. It manages the whole lifecycle: start, stop, rebuild, view status, stream logs, run one-off commands.
Expose ports to linked services only (not published to host)
networks
Networks to join
network_mode
Special network mode (host, none, service:name)
dns
Custom DNS servers
dns_opt
DNS options
dns_search
DNS search domains
extra_hosts
Additional hostname mappings
Storage
Attribute
Description
volumes
Volume mounts (supports short and long syntax with type, source, target, read_only, etc.)
volumes_from
Mount volumes from another service/container
tmpfs
Temporary filesystem mounts
Dependencies & Ordering
Attribute
Description
depends_on
Control startup/shutdown order. Short syntax: service names. Long syntax: condition (service_started, service_healthy, service_completed_successfully), required (bool), restart (bool)
Configuration & Secrets
Attribute
Description
environment
Container environment variables (map or array syntax)
env_file
Files containing environment variables (supports required and format attributes)
configs
Grant access to configs (short or long syntax with source, target, uid, gid, mode)