Avatar
Cover

Docker

Docker Commands

Container Lifecycle

Image Management

Networking

Volumes

System & Info


Docker Compose Commands

Core Workflow

Service Management

Scaling


Example docker-compose.yml Snippet

version: "3.9"
services:
  web:
    image: nginx:latest
    ports:
      - "80:80"
  db:
    image: postgres:15
    environment:
      POSTGRES_PASSWORD: example

Tips

  • Use v to map volumes (e.g., v /host/path:/container/path).
  • Use p to map ports (e.g., p 8080:80).
  • Use -env-file to load environment variables from a file.
  • For Docker Compose, ensure docker-compose.yml is in your working directory or use f [file].

Let me know if you need help with a specific workflow! 🐳