docker

Installation
SKILL.md

Docker

Overview

Docker packages applications into isolated containers that run consistently across environments. A Dockerfile defines the image build steps, Compose orchestrates multi-container services, and production patterns ensure small, secure, performant images.

When to use: Containerizing applications, creating reproducible dev environments, orchestrating multi-service stacks, deploying to container platforms (ECS, Kubernetes, Fly.io, Railway, Coolify).

When NOT to use: Simple static sites with no backend (use CDN deploy), single-binary CLI tools (distribute the binary), or when the target platform has native buildpacks (Heroku, Vercel) and you don't need container control.

Quick Reference

Pattern Approach Key Points
Multi-stage build Separate builder and production stages 80%+ image size reduction, no dev deps in production
Layer caching Copy lockfile first, install, then copy source Dependency layer cached across builds
Non-root user RUN adduser + USER in final stage Never run production containers as root
Health check HEALTHCHECK CMD curl or node/python check Enables orchestrator restart on failure
.dockerignore Exclude node_modules, .git, .env Smaller build context, faster builds
Related skills
Installs
41
GitHub Stars
11
First Seen
Feb 22, 2026