ecc-docker-patterns

Reviews and guides Dockerfile and Compose configurations for containerized development workflows.

Updated Apr 18, 2025
One-click install
npx skills add https://github.com/adriancodes/dotfiles --skill ecc-docker-patterns-adriancodes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ecc-docker-patterns
Source: https://github.com/adriancodes/dotfiles/tree/main/dot_agents/skills/ecc-docker-patterns
Command: npx skills add https://github.com/adriancodes/dotfiles --skill ecc-docker-patterns-adriancodes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing secure, reproducible Dockerfiles and Compose stacks is error-prone: developers commonly ship root containers, :latest tags, leaked secrets, and untested installers. This Skill provides reviewed patterns and hardening rules for containerized development. ## Core Features & Use Cases - Compose Stack Patterns: Standard web app stacks with Postgres, Redis, and Mailpit, including healthchecks, named volumes, and dev/prod override files. - Dockerfile Hardening: Multi-stage builds, non-root users, pinned image tags, read-only filesystems, capability dropping, and secret management via Compose secrets. - Isolated Installer Testing: Hardened container harnesses for testing CLI installers across Linux distributions, with read-only mounts, tmpfs workspaces, no network, and explicit platform boundaries for macOS and Windows. - Use Case: When reviewing a project's docker-compose.yml, apply these patterns to bind ports to localhost, add database healthchecks, move secrets out of the file, and split dev and production configurations. ## Quick Start Review my Dockerfile and docker-compose.yml using the docker patterns skill and suggest security and structure improvements.

Frequently Asked Questions about ecc-docker-patterns

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

FAQPage Schema
How do I structure a multi-stage Dockerfile for Node.js?▼

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

How do I set up Docker Compose for local development with Postgres?▼

Define services for the app, Postgres, and Redis with a healthcheck on the database using pg_isready. Bind ports to 127.0.0.1, use named volumes for data persistence, and require the database password via an environment variable.

Can Docker containers test macOS or Windows installer behavior?▼

No. Docker shares a Linux kernel, so Linux containers cannot validate macOS or Windows behavior. Run platform-independent logic on native macOS and Windows CI runners, and reserve Windows containers for a Windows Docker engine.

How do I keep secrets out of Docker images and Compose files?▼

Never place secrets in image layers, build arguments, or committed Compose files. Use Compose file-backed secrets mounted at /run/secrets from a private file outside version control, or a platform secret store where available.

Why should containers run as non-root with read-only filesystems?▼

Running as non-root with read_only: true, cap_drop: [ALL], and no-new-privileges limits the damage a compromised process can do. Writable needs are handled with scoped tmpfs mounts such as /tmp and cache directories.

What are common Docker Compose anti-patterns to avoid?▼

Avoid running as root, using :latest tags, storing data only in writable container layers, putting secrets in compose files, and combining all services into one container. Pin versions, use volumes, and separate concerns per container.