docker-patterns

Configure Docker Compose stacks, Dockerfiles, networking, volumes, and container security for development environments.

Updated Jun 12, 2026
One-click install
npx skills add https://github.com/bilacchi/agents-skills --skill docker-patterns-bilacchi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docker-patterns
Source: https://github.com/bilacchi/agents-skills/tree/main/skills/docker-patterns
Command: npx skills add https://github.com/bilacchi/agents-skills --skill docker-patterns-bilacchi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up containerized development environments involves many error-prone decisions: multi-stage Dockerfiles, service networking, volume strategies, and security hardening. This Skill provides proven Docker and Docker Compose patterns so you avoid common misconfigurations like running as root, losing data without volumes, or leaking secrets into images. ## Core Features & Use Cases - Docker Compose Stacks: Ready-to-adapt multi-service configurations with healthchecks, dependency ordering, and override files for dev versus production. - Multi-Stage Dockerfiles: Patterns separating dependencies, dev, build, and production stages with non-root users and minimal images. - Networking & Volumes: Service discovery by name, custom network isolation, bind mounts for hot reload, and named volumes for persistence. - Security Hardening: Capability dropping, read-only filesystems, secret management via .env files or Docker secrets, and pinned image tags. - Use Case: You are containerizing a Node.js app with Postgres and Redis. Apply the standard web app stack pattern to get hot reload, healthy service startup ordering, and local email testing with Mailpit in minutes. ## Quick Start Set up a Docker Compose development environment for my Node.js app with Postgres and Redis using the docker-patterns skill.

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 healthchecks so dependent services wait for readiness. Use an anonymous volume over node_modules to prevent the host bind mount from overwriting container dependencies.

How do I make one container wait for a database to be ready?▼

Add a healthcheck to the database service, such as pg_isready for Postgres, then set depends_on with condition: service_healthy on the dependent service. Compose will start the app only after the database passes its healthcheck.

Should I use bind mounts or named volumes in Docker Compose?▼

Use bind mounts for source code during development to enable hot reload, and named volumes for persistent data like Postgres storage that must survive container restarts. Anonymous volumes protect container-generated directories like node_modules from bind mount overrides.

How do I keep secrets out of Docker images?▼

Inject secrets at runtime using env_file pointing to a gitignored .env file, or use Docker secrets in Swarm mode. Never hardcode credentials with ENV instructions in a Dockerfile, since they persist in image layers.

Why is running containers as root a problem?▼

A root process inside a container can escalate to host access if the container is compromised. Create a non-root user in the Dockerfile with adduser, switch with USER, and combine with no-new-privileges, dropped capabilities, and a read-only filesystem.

When should I not use Docker Compose in production?▼

Docker Compose lacks orchestration features like auto-healing, scaling, and rolling deployments across hosts. For production multi-container workloads, use Kubernetes, ECS, or Docker Swarm instead, keeping Compose for local development.