docker-compose.yaml

A standard Docker Compose file defining a web app and a database service.

Open in YAML Formatter

About this format

Docker Compose uses YAML to define multi-container applications. It specifies images, ports, and environment variables.

Example Data

version: "3.9"
services:
  web:
    build: .
    ports:
      - "8000:8000"
    environment:
      - NODE_ENV=production
  db:
    image: postgres:15
    environment:
      - POSTGRES_PASSWORD=secret

When to use docker-compose.yaml

  • Orchestrating local development environments
  • Defining production service stacks
  • Mapping container ports and volumes