docker-patterns

Configure Docker Compose stacks, hardened Dockerfiles, networking, and volumes for containerized development.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/freedom909/real-estate-saas --skill docker-patterns-freedom909
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docker-patterns
Source: https://github.com/freedom909/real-estate-saas/tree/main/.trae/skills/docker-patterns
Command: npx skills add https://github.com/freedom909/real-estate-saas --skill docker-patterns-freedom909

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 avoid these mistakes from the start. ## Core Features & Use Cases - Docker Compose Stacks: Ready-to-adapt multi-service configurations with healthchecks, dependency ordering, and dev/prod override files. - Dockerfile Hardening: Multi-stage builds, non-root users, pinned image tags, and read-only filesystems for secure, minimal images. - Networking & Volumes: Service discovery via Compose DNS, custom network segmentation, and correct bind-mount versus named-volume strategies. - Use Case: You are containerizing a Node.js app with PostgreSQL and Redis. Use this Skill to generate a Compose file where the app waits for a healthy database, node_modules survive bind mounts, and secrets stay out of image layers. ## Quick Start Ask the AI to create a Docker Compose setup 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 bind mounts for hot reload, anonymous volumes to protect node_modules, and healthchecks so dependent services wait for readiness. Use docker-compose.override.yml for dev-only settings like debug ports.

How to make a Dockerfile secure for production?▼

Use multi-stage builds with a minimal final stage, pin exact image tags instead of latest, create and switch to a non-root user, and never bake secrets into image layers. Add a HEALTHCHECK and drop Linux capabilities in Compose.

How do Docker Compose containers communicate with each other?▼

Services on the same Compose network resolve each other by service name via built-in DNS, so the app connects to postgres://db:5432 directly. Custom networks let you isolate tiers, such as keeping the database unreachable from the frontend.

Why does my node_modules disappear when using bind mounts?▼

A bind mount of the project directory overwrites the container's node_modules with the host's. Add an anonymous volume like /app/node_modules after the bind mount to preserve the container-installed dependencies.

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.