container enabled verified low v1.0.0

docker-compose

Multi-container orchestration tool for defining and running complex Docker application stacks.

📋 Live Preview
docker-compose {all-resources} {ansi} {compatibility} {dry-run} {env-file}
๐Ÿ“Ž all-resources ๐Ÿ“Ž ansi ๐Ÿ“Ž compatibility ๐Ÿ“Ž dry-run ๐Ÿ“Ž env-file
docker-compose {all-resources} {ansi} {compatibility} {dry-run} {env-file}

Sandbox: execFile · Timeout: 300s

Capabilities

container.orchestrate.compose
container.orchestrate.stack
container.service.manage
container.network.multi
container.storage.volume
container.logs.tail

Parameters

Name Type Required Default Description Aliases
all-resources string No - Include all resources, even those not --all-resources
ansi string No - Control when to print ANSI control --ansi
compatibility string No - Run compose in backward compatibility mode --compatibility
dry-run string No - Execute command in dry run mode --dry-run
env-file string No - Specify an alternate environment file --env-file
file string No - Compose configuration files -f, --file
parallel string No - Control max parallelism, -1 for --parallel
profile file No - Specify a profile to enable --profile
progress string No - Set type of progress output (auto --progress
project-directory file No - Specify an alternate working directory --project-directory
project-name string No - Project name -p, --project-name

Artifacts

TypeDescriptionMIMESchemaTrust
container.image.ociBuilt container imageapplication/vnd.oci.image.manifest.v1+json-verified
container.runtime.logsContainer service logstext/plain-verified
container.stack.configDocker Compose stack configurationapplication/x-yaml-verified

Contract

Inputs

container.stack.composefile

Docker Compose YAML file

container.image.oci

Container images to use in the stack

Outputs

container.stack.running

Running container stack

container.runtime.logs

Aggregated service logs

Side effects: network_trafficfilesystem_writeprocess_spawn

Workflow Edges

Produces

container.stack.runningcontainer.runtime.logs

Consumes

container.stack.composefilecontainer.image.oci

Resource Profile

ResourceValue
CPUmedium
Memory128 MB
Networkmedium
Disk I/Omedium

Examples

Start all services in background

docker-compose up -d

Build and start services

docker-compose up -d --build

View running services

docker-compose ps

Tail logs from all services

docker-compose logs -f

Execute command in a running service

docker-compose exec web bash

Stop and remove all resources

docker-compose down -v

Documentation

Docker Compose โ€” Multi-Container Orchestration

Docker Compose is a tool for defining and running multi-container Docker applications. Using a YAML file, you configure all services, networks, and volumes, then start everything with a single command.

Compose File Structure

version: "3.8"
services:
  web:
    build: .
    ports:
      - "8080:80"
    depends_on:
      - db
  db:
    image: postgres:16
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  postgres_data:

Common Workflows

Development

# Start development stack
docker-compose up -d

# Rebuild specific service
docker-compose build web

# View logs during development
docker-compose logs -f web

# Run one-off commands
docker-compose exec web pytest

Production

# Pull latest images
docker-compose pull

# Graceful restart
docker-compose restart -t 30

# Scale a service
docker-compose up -d --scale worker=3

Cleanup

# Stop containers
docker-compose stop

# Stop and remove everything
docker-compose down

# Remove everything including volumes
docker-compose down -v --rmi all

Related Tools

Dependencies

docker

Related Tools

dockerdocker-swarmkubernetespodman-compose

References