docker-patterns

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

2|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/adamreger/ecc-antigravity --skill docker-patterns-adamreger
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docker-patterns
Source: https://github.com/adamreger/ecc-antigravity/tree/main/skills/docker-patterns
Command: npx skills add https://github.com/adamreger/ecc-antigravity --skill docker-patterns-adamreger

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 - Docker Compose Stacks: Ready-to-adapt configurations for web app stacks with PostgreSQL, Redis, and Mailpit, including healthchecks and dependency ordering. - Multi-Stage Dockerfiles: Separate dev, build, and production stages with non-root users, pinned base images, and minimal production footprints. - Networking & Volumes: Custom network segmentation, service discovery by name, and volume strategies that protect node_modules while enabling hot reload. - Security Hardening: Read-only filesystems, capability dropping, secret management via env files or Docker secrets, and .dockerignore templates. - Use Case: When starting a new Node.js project, use this Skill to generate a docker-compose.yml with a healthy Postgres dependency, a hardened multi-stage Dockerfile, and debugging commands for troubleshooting. ## Quick Start Ask the agent to set up a Docker Compose development environment for your 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 bind mounts for hot reload, healthchecks for dependency ordering, and named volumes for data persistence. Use docker compose up to start the stack, which auto-loads docker-compose.override.yml for dev-only settings.

How do I make a Dockerfile production-ready?▼

Use multi-stage builds to separate dependencies, build, and production stages. Pin base image versions, run as a non-root user, prune dev dependencies, and add a HEALTHCHECK instruction to the final minimal image.

How do Docker Compose services communicate with each other?▼

Services on the same Compose network resolve each other by service name via built-in DNS. For example, an app container can reach PostgreSQL at db:5432. Custom networks let you isolate tiers so the database is only reachable from the API.

Should I use Docker Compose in production?▼

Docker Compose is designed for local development and single-host setups. For production multi-container workloads, use an orchestrator like Kubernetes, ECS, or Docker Swarm, which provide scaling, self-healing, and rolling deployments.

Why does my container lose data after restart?▼

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

How do I keep secrets out of Docker images?▼

Never hardcode secrets with ENV in a Dockerfile, since they persist in image layers. Instead inject them at runtime via gitignored .env files, host environment variables, or Docker secrets mounted as files.