affaan-m avatar

Docker Patterns

Covers the Docker Compose patterns you actually need for local development: multi-stage Dockerfiles that separate dev from production builds, service dependency management with health checks, volume strategies that preserve your node_modules while enabling hot reload, and network isolation between frontend and backend services. The examples are practical (complete postgres and redis setups, debugging commands, proper secret handling) and it includes the security hardening steps people usually skip until something breaks. Especially useful if you're moving a project into containers or debugging why your database connection works locally but not in Docker.

skills.sh installs
7.7K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --skill docker-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Docker Patterns

Docker and Docker Compose best practices for containerized development.

Docker Compose for Local Development

Standard Web App Stack

# docker-compose.yml
services:
  app:
    build:
      context: .
      target: dev                     # Use dev stage of multi-stage Dockerfile
    ports:
      - "3000:3000"
    volumes:
      - .:/app                        # Bind mount for hot reload
      - /app/node_modules             # Anonymous volume -- preserves container deps
    environment:
      - DATABASE_URL=postgres://postgres:postgres@db:5432/app_dev
      - REDIS_URL=redis://redis:6379/0
      - NODE_ENV=development
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_started
    command: npm run dev

Sponsors

Details

Repository
github.com/affaan-m/ecc
Categories
Security, DevOps & CI/CD, Automation & Workflows, Mobile Development
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263

Recommended

More Security
1getsentry avatarfind-bugsgetsentry/skillsFind bugs, security vulnerabilities, and code quality issues in local branch changes. Use when asked to review changes, find bugs, security review, or audit cod7.3Kskills.sh installs
2jeffallan avatarfastapi-expertjeffallan/claude-skillsUse when building high-performance async Python APIs with FastAPI and Pydantic V2. Invoke to create REST endpoints, define Pydantic models, implement authentica6.4Kskills.sh installs
3testdino-hq avatarplaywright-skilltestdino-hq/playwright-skillBattle-tested Playwright patterns for writing, debugging, and scaling reliable test suites. Use when you need guidance for E2E, API, component, visual, accessib6.2Kskills.sh installs
4grafana avatargrafana-ossgrafana/skillsConfigure Grafana OSS — provisions dashboards from YAML, sets up data sources (Prometheus / Loki / Tempo / Pyroscope), writes dashboard JSON with template varia6Kskills.sh installs
5affaan-m avatarlaravel-tddaffaan-m/eccLaravel testing strategies with PHPUnit, Pest, model factories, HTTP tests, Sanctum authentication testing, mocking, and coverage.6Kskills.sh installs
6vintasoftware avatardjango-expertvintasoftware/django-ai-pluginsExpert Django backend development guidance. Use when creating Django models, views, serializers, or APIs; debugging ORM queries or migrations; optimizing databa5.9Kskills.sh installs