docker
Installation
SKILL.md
Docker
Patterns and decisions for containerizing applications and managing containers locally or in self-hosted environments.
Dockerfile: Single-Stage vs Multi-Stage
Use single-stage only for interpreted languages where you don't need a separate build step (e.g., Python running directly, simple shell scripts).
Use multi-stage for everything else. The size difference is dramatic: a single-stage Node.js image is ~1.9 GB uncompressed; the equivalent multi-stage image is ~607 MB (75% smaller after compression). Multi-stage also prevents source code, dev dependencies, and build secrets from leaking into the final image.
Single-stage (basic — has known problems)
# syntax=docker/dockerfile:1
FROM node:24.7-trixie
WORKDIR /usr/src/app