containerizationlisted
Install: claude install-skill ecoma-io/touchstone
# Containerization
Containers package the application and its dependencies into a reproducible unit. They answer: "will this run the same way everywhere?"
## Image layering
Order matters. Least-frequently-changing layers first (OS packages → language runtime → dependencies → application code). A one-line code change should rebuild only the last layer.
## Multi-stage builds
Build in one stage, run in another. The production image contains no compilers, no dev dependencies, no source code — only the artifact and its runtime.
## Image size
A 2GB image is a deployment delay. Strip package manager caches, remove temp files, use `--no-install-recommends`. The image is the unit of deployment; smaller images deploy faster and have a smaller attack surface.
## Non-root
The container must not run as root. `USER 1000` or equivalent. A compromised process running as root owns the node.
## Health checks
The container must report its own health. `HEALTHCHECK` in Docker, `livenessProbe`/`readinessProbe` in Kubernetes. A container that is running but not serving is worse than one that crashed — it looks alive but silently fails.