šŸŽ¼

Docker Compose

Multi-container applications made easy

Step 1 of 3

What is Compose?

Docker Compose lets you define and run multi-container apps with a single YAML file. Start everything with `docker compose up`.

bash
# docker-compose.yml
services:
  web:
    image: nginx
    ports:
      - "8080:80"
  api:
    build: ./api
    environment:
      - DB_HOST=db
  db:
    image: postgres
    volumes:
      - pgdata:/var/lib/postgresql/data
volumes:
  pgdata:

docker-compose.yml

🌐
web
āš™ļø
api
šŸ—„ļø
db
ports: 8080:80depends_on: dbvolumes: pgdata