Docker Compose

Define multi-container applications with proper dependency handling, networking, and volume management.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Docker Compose" with this command: npx skills add ivangdavila/docker-compose

depends_on Ready Condition

  • depends_on: alone only waits for container start—service likely not ready yet
  • Add healthcheck + condition for actual readiness:
depends_on:
  db:
    condition: service_healthy
  • Without healthcheck defined on target service, service_healthy fails

Healthcheck start_period

healthcheck:
  test: ["CMD", "pg_isready"]
  start_period: 30s
  • start_period: initial grace period—health failures don't count during this time
  • Slow-starting services (databases, Java apps) need adequate start_period
  • Without it, container marked unhealthy before it finishes initializing

Volume Destruction

  • docker compose down preserves volumes
  • docker compose down -v DELETES ALL VOLUMES—data loss
  • -v often added by habit from tutorials—catastrophic in production
  • Named volumes survive down; anonymous volumes deleted on down

Resource Limits in Development

deploy:
  resources:
    limits:
      memory: 512M
  • Set limits during development—catches memory issues early
  • Unlimited container can consume all host memory—kills other processes
  • Copy limits to production config—don't discover limits in prod

.dockerignore

  • Without it: node_modules, .git, secrets copied into image
  • Mirrors .gitignore syntax—create at same level as Dockerfile
  • Large build context = slow builds, large images, potential security issues
  • At minimum: .git, node_modules, .env, *.log, build artifacts

Override File Pattern

  • docker-compose.yml: base config that works everywhere
  • docker-compose.override.yml: auto-loaded, development-specific (mounts, ports)
  • Production: docker compose -f docker-compose.yml -f docker-compose.prod.yml up
  • Keep secrets and environment-specific config in override files, not base

Profiles for Optional Services

services:
  mailhog:
    profiles: [dev]
  • Services with profiles don't start by default—cleaner docker compose up
  • Enable with --profile dev
  • Use for: test databases, debug tools, mock services, admin interfaces

Environment Variable Precedence

  1. Shell environment (highest)
  2. .env file in compose directory
  3. env_file: directive
  4. environment: in compose file (lowest for that var)
  • .env must be exactly .env.env.local not auto-loaded
  • Debug with docker compose config—shows resolved values

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

Memoclaw Skill

Memory-as-a-Service for AI agents. Store and recall memories with semantic vector search. 100 free calls per wallet, then x402 micropayments. Your wallet add...

Registry SourceRecently Updated
Web3

WachAI-x402

DeFi risk analysis toolkit powered by WACH.AI via x402 payments using AWAL wallet custody. Use when the user asks to check if a token is safe, assess DeFi ri...

Registry SourceRecently Updated
Web3

The Swarm

Earn passive income as an AI agent. Join The Swarm - a crypto-powered social network where agents earn XP and money helping each other grow YouTube channels. No Phantom extension needed - full CLI auth for autonomous agents. Solana wallet, earn crypto, passive revenue, agent economy.

Registry SourceRecently Updated