Docker Skill
Production Docker — from optimised Dockerfiles to multi-service compose stacks and CI/CD integration.
RULE: Show Dockerfile and compose files before building. Warn before any docker system prune or volume removal.
🚧 Status: Stub — implementation pending
This reference skill has the structure but the snippet content is still being filled in
(you'll see <!-- TODO --> placeholders below). It activates and tells Claude the topic
exists, but won't yield deep snippets yet.
Want to help? Pick any TODO, write the snippet, open a PR. See CONTRIBUTING.md.
Each contribution moves the skill closer to "Ready" status.
Capabilities
Dockerfile Best Practices
docker-compose Setup
Multi-Stage Builds
Container Networking
Volume Management
Docker in CI/CD
Templates
Node.js multi-stage
# Stage 1: build
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: runtime
FROM node:20-alpine AS runner
RUN addgroup -S app && adduser -S app -G app
WORKDIR /app
COPY --from=builder --chown=app:app /app/dist ./dist
COPY --from=builder --chown=app:app /app/node_modules ./node_modules
COPY --from=builder --chown=app:app /app/package.json .
USER app
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s CMD wget -qO- http://localhost:3000/health || exit 1
CMD ["node", "dist/index.js"]
Python multi-stage
FROM python:3.12-slim AS builder
WORKDIR /app
RUN pip install uv
COPY requirements.txt .
RUN uv pip install --system -r requirements.txt
FROM python:3.12-slim AS runner
RUN useradd -m app
WORKDIR /app
COPY --from=builder /usr/local/lib/python3.12 /usr/local/lib/python3.12
COPY --chown=app:app . .
USER app
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
.dockerignore
node_modules/
.venv/
__pycache__/
*.pyc
.git/
.env
.env.*
dist/
build/
*.log
README.md
.DS_Store
1---2name: docker3description: Docker best practices — Dockerfile authoring, docker-compose, multi-stage builds, container networking, volume management, Docker in CI/CD4---56# Docker Skill78Production Docker — from optimised Dockerfiles to multi-service compose stacks and CI/CD integration.910**RULE: Show Dockerfile and compose files before building. Warn before any `docker system prune` or volume removal.**1112> **🚧 Status: Stub — implementation pending**13>14> This reference skill has the structure but the snippet content is still being filled in15> (you'll see `<!-- TODO -->` placeholders below). It activates and tells Claude the topic16> exists, but won't yield deep snippets yet.17>18> **Want to help?** Pick any TODO, write the snippet, open a PR. See [CONTRIBUTING.md](../../CONTRIBUTING.md).19> Each contribution moves the skill closer to "Ready" status.2021---2223## Capabilities2425### Dockerfile Best Practices26<!-- TODO: Layer caching strategy, .dockerignore, non-root user -->27<!-- TODO: COPY vs ADD, ARG vs ENV, ENTRYPOINT vs CMD -->28<!-- TODO: Healthcheck instruction, signal handling (tini/dumb-init) -->29<!-- TODO: Minimal base images (alpine, distroless, scratch) -->3031### docker-compose Setup32<!-- TODO: Services, networks, volumes, depends_on with healthcheck -->33<!-- TODO: Override files (docker-compose.override.yml for dev) -->34<!-- TODO: Profiles for optional services (--profile tools) -->35<!-- TODO: Secrets in compose, environment file patterns -->3637### Multi-Stage Builds38<!-- TODO: Builder stage (full deps) → runner stage (minimal) -->39<!-- TODO: Node.js: build stage with devDeps → runtime with only dist/ -->40<!-- TODO: Go: compile stage → scratch runtime (5MB binary) -->41<!-- TODO: Python: venv in builder → copy to slim runtime -->4243### Container Networking44<!-- TODO: Bridge, host, overlay networks -->45<!-- TODO: Service discovery by name in compose -->46<!-- TODO: Exposing ports vs internal-only services -->47<!-- TODO: Connecting to host services from container (host.docker.internal) -->4849### Volume Management50<!-- TODO: Named volumes vs bind mounts vs tmpfs -->51<!-- TODO: Volume backup strategies (docker run --volumes-from) -->52<!-- TODO: Dev workflow: bind mount source code for hot reload -->53<!-- TODO: Database volumes: never bind-mount prod DB data -->5455### Docker in CI/CD56<!-- TODO: GitHub Actions docker/build-push-action, layer cache with gha -->57<!-- TODO: BuildKit cache mounts (pip, npm, apt) -->58<!-- TODO: Multi-platform builds (buildx, amd64 + arm64) -->59<!-- TODO: ECR/GHCR push, image signing (cosign) -->6061---6263## Templates6465### Node.js multi-stage66```dockerfile67# Stage 1: build68FROM node:20-alpine AS builder69WORKDIR /app70COPY package*.json ./71RUN npm ci72COPY . .73RUN npm run build7475# Stage 2: runtime76FROM node:20-alpine AS runner77RUN addgroup -S app && adduser -S app -G app78WORKDIR /app79COPY --from=builder --chown=app:app /app/dist ./dist80COPY --from=builder --chown=app:app /app/node_modules ./node_modules81COPY --from=builder --chown=app:app /app/package.json .82USER app83EXPOSE 300084HEALTHCHECK --interval=30s --timeout=5s CMD wget -qO- http://localhost:3000/health || exit 185CMD ["node", "dist/index.js"]86```8788### Python multi-stage89```dockerfile90FROM python:3.12-slim AS builder91WORKDIR /app92RUN pip install uv93COPY requirements.txt .94RUN uv pip install --system -r requirements.txt9596FROM python:3.12-slim AS runner97RUN useradd -m app98WORKDIR /app99COPY --from=builder /usr/local/lib/python3.12 /usr/local/lib/python3.12100COPY --chown=app:app . .101USER app102EXPOSE 8000103CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]104```105106### .dockerignore107```108node_modules/109.venv/110__pycache__/111*.pyc112.git/113.env114.env.*115dist/116build/117*.log118README.md119.DS_Store120```121122<!-- TODO: Add full interactive workflows for each capability above -->