docker-patterns

Configures Docker Compose stacks, hardened Dockerfiles, networking, and volume strategies for containerized development.

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill docker-patterns-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-patterns
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/docker-patterns
Command: npx skills add https://github.com/ibytechaos/claude --skill docker-patterns-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up reliable containerized development environments involves many pitfalls: broken service dependencies, leaked secrets, bloated images, and networking confusion. This Skill provides proven Docker and Docker Compose patterns so you can build secure, maintainable multi-container setups without trial and error. ## Core Features & Use Cases - Compose Stack Templates: Ready-made multi-service configurations (app, PostgreSQL, Redis, Mailpit) with healthchecks, dependency ordering, and dev/prod override files. - Dockerfile Hardening: Multi-stage builds with non-root users, pinned image tags, read-only filesystems, capability dropping, and secret management via .env files or Docker secrets. - Networking & Volumes: Custom network segmentation, service discovery by name, bind mounts for hot reload, and named volumes for persistent data. - Use Case: You are starting a Node.js web app that needs Postgres and Redis locally. Use this Skill to generate a docker-compose.yml with healthchecks, a multi-stage Dockerfile with dev and production targets, and a .dockerignore, then debug container issues with the included command reference. ## Quick Start Ask the AI to set up a Docker Compose development environment for your web app with a database, following the docker-patterns best practices.

Frequently Asked Questions about docker-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Docker Compose for local development?

Define services in docker-compose.yml with build contexts, port mappings, bind mounts for hot reload, and healthchecked dependencies like PostgreSQL. Use depends_on with service_healthy conditions so the app starts only after the database is ready.

How to write a multi-stage Dockerfile for Node.js?

Use separate stages for dependencies, development, build, and production. Copy only production node_modules and built assets into the final stage, run as a non-root user, and add a HEALTHCHECK instruction for the running server.

Should Docker containers run as root?

No, containers should run as a non-root user created in the Dockerfile. Combine this with read_only filesystems, dropped capabilities, and no-new-privileges in Compose to reduce the impact of container compromise.

How do containers communicate in Docker Compose?

Services on the same Compose network resolve each other by service name via built-in DNS. Use custom networks to isolate tiers, for example keeping the database reachable only from the API service and not the frontend.

Why is my Docker container data lost after restart?

Containers are ephemeral, so data written inside them disappears on removal. Mount a named volume such as pgdata to /var/lib/postgresql/data to persist database files across container restarts.

When should I not use Docker Compose in production?

Docker Compose is suited for local development and single-host setups, not production multi-container orchestration. For production workloads, use Kubernetes, ECS, or Docker Swarm for scheduling, scaling, and failover.