docker-patterns

Implements Docker Compose configurations, multi-stage Dockerfiles, networking, volumes, and container security patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up reliable containerized development environments requires juggling Docker Compose services, networking, volumes, and security hardening, and mistakes lead to broken local stacks, leaked secrets, or bloated production images. ## Core Features & Use Cases - Compose Stack Templates: Provides a standard web app stack (app, PostgreSQL, Redis, Mailpit) with healthchecks, dependency ordering, and override files for dev versus production. - Multi-Stage Dockerfiles: Separates dependencies, dev, build, and production stages with non-root users and healthchecks for minimal production images. - Networking, Volumes & Security: Covers service discovery, custom networks, bind versus named volumes, .dockerignore, secret management, and container hardening with cap drops and read-only filesystems. - Use Case: When bootstrapping a new web project, apply the Compose template to spin up the app, database, and cache locally, then use the production stage and security patterns to ship a hardened image. ## Quick Start Ask the assistant to set up a Docker Compose local development stack with PostgreSQL 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 for your app, database, and cache in docker-compose.yml with healthchecks and depends_on conditions. Use bind mounts for hot reload source code and anonymous volumes to protect container node_modules from the host.

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

Create separate stages for dependencies, dev, build, and production using node:22-alpine. Copy only built artifacts and production node_modules into the final stage, run as a non-root user, and add a HEALTHCHECK instruction.

How do Docker Compose services communicate with each other?▼

Services on the same Compose network resolve each other by service name, so the app connects to postgres://db:5432 or redis://redis:6379 directly. Custom networks let you isolate tiers, such as keeping the database reachable only from the API.

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

Use bind mounts for source code during development to enable hot reload, and named volumes for persistent data like PostgreSQL storage. Anonymous volumes protect container-generated directories such as node_modules from being overwritten by bind mounts.

Why is running containers as root a security risk?▼

A root process inside a container can escalate to host access if the container is compromised. Create a non-root user in the Dockerfile, drop all capabilities, set no-new-privileges, and use a read-only root filesystem where possible.

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.