| 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 |
| Compose services | compose.yaml with service definitions | Dev environment in one command |
| Compose override | compose.prod.yaml with production settings | Environment-specific config without duplication |
| Named volumes | volumes: in Compose for persistent data | Survives container recreation |
| Build cache mount | RUN --mount=type=cache,target=/root/.npm | Persistent cache across builds |
| Secrets in build | RUN --mount=type=secret,id=token | Never bake secrets into image layers |
| Image pinning | Pin to major.minor or digest | Reproducible builds, avoid surprise breakage |
| Container networking | Custom bridge networks with service discovery | Containers resolve each other by service name |
| Compose watch | develop.watch with sync/rebuild actions | Live reload without volume mounts |
| Init process | --init flag or tini entrypoint | Proper signal handling and zombie reaping |
| Multi-platform | docker buildx build --platform | ARM (Apple Silicon, Graviton) + x86 in one image |
| Monorepo prune | turbo prune app --docker | Minimal build context from workspace dependencies |
| CI layer caching | cache-from/cache-to with GHA or registry | Avoid full rebuilds in CI pipelines |
| Debug containers | docker exec, docker logs, dive | Inspect running containers and image layers |