Skip to content
Skills Library
DevOps & cloud · Building & coding

docker

/docker

Use when writing or reviewing Dockerfiles, docker-compose files, or .dockerignore for any backend service. Covers multi-stage builds, container security hardening, compose orchestration, advanced build patterns, and a Docker review checklist for all 4 stacks: NestJS/Node 24, Spring Boot WebFlux 3.5.x/Java 21, Python FastAPI 3.14, and TypeScript/Fastify/Node 24.

Licence
MIT
Last repository change
30.06.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
5
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 30.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when writing or reviewing Dockerfiles, docker-compose files, or .dockerignore for any backend service. Covers multi-stage builds, container security hardening, compose orchestration, advanced build patterns, and a Docker review checklist for all 4 stacks: NestJS/Node 24, Spring Boot WebFlux 3.5.x/Java 21, Python FastAPI 3.14, and TypeScript/Fastify/Node 24.

Original author description

Use when writing or reviewing Dockerfiles, docker-compose files, or .dockerignore for any backend service. Covers multi-stage builds, container security hardening, compose orchestration, advanced build patterns, and a Docker review checklist for all 4 stacks: NestJS/Node 24, Spring Boot WebFlux 3.5.x/Java 21, Python FastAPI 3.14, and TypeScript/Fastify/Node 24.

How it works

  1. Iron Law
  2. When to Use
  3. How This Skill Relates to Others
  4. Process
  5. Reference Files
  6. Error Handling
Original SKILL.md headings · 84 lines, 614 words
SKILL.md preview
---
name: docker
description: Use when writing or reviewing Dockerfiles, docker-compose files, or .dockerignore for any backend service. Covers multi-stage builds, container security hardening, compose orchestration, advanced build patterns, and a Docker review checklist for all 4 stacks: NestJS/Node 24, Spring Boot WebFlux 3.5.x/Java 21, Python FastAPI 3.14, and TypeScript/Fastify/Node 24.
allowed-tools: Bash, Read, Write, Edit
metadata:
  triggers: Dockerfile, docker-compose, containerize, docker build, multi-stage build, docker image, container, dockerignore, docker run, docker scout
  related-skills: java-spring-api, nestjs-api, python-dev, agentic-ai-dev, architecture-design
  domain: infrastructure
  role: specialist
  scope: implementation
  output-format: code
last-reviewed: "2026-03-14"
---

## Iron Law

**NO DOCKERFILE WITHOUT READING `reference/dockerfiles.md` FIRST — each stack has specific base images, build tools, and health check patterns that must be used exactly**

# Docker

Production-ready containerization for NestJS/Node 24, Spring Boot WebFlux 3.5.x/Java 21, Python FastAPI 3.14, and TypeScript/Fastify/Node 24. All patterns follow: multi-stage build, non-root user, HEALTHCHECK, .dockerignore.

## When to Use

- Writing a Dockerfile for any backend service
- Writing or updating docker-compose files for local dev or production
- Reviewing an existing Dockerfile for security, size, or correctness
- Adding build cache optimization (`--mount=type=cache`)
- Setting up Docker Compose secrets for production
- Building multi-architecture images (linux/amd64 + linux/arm64)
- Debugging container build failures, slow builds, or large image sizes

## How This Skill Relates to Others

| Skill | Scope |
|-------|-------|
| **docker** (this skill) | Container definitions, compose files, build patterns |
| **java-spring-api** | Java application code — loads docker skill for Dockerfile |
| **nestjs-api** | NestJS templates include Dockerfile — this skill extends those patterns |
| **python-dev** | FastAPI code — loads docker skill for Dockerfile |
| **agentic-ai-dev** | Python agent code — has deployment reference that this skill augments |

## Process

### Step 1: Choose the Right Dockerfile Pattern

Read `reference/dockerfiles.md` for the complete, copy-ready Dockerfile for your stack:

| Stack | Base Image | Build Tool | Port |
|-------|-----------|-----------|------|
| NestJS 11.x / Node 24 | node:24-alpine | pnpm | 3000 |
| Spring Boot WebFlux 3.5.x | maven:3.9-eclipse-temurin-21-alpine → eclipse-temurin:21-jre-alpine | Maven | 8080 |
| Python FastAPI 3.14 | python:3.14-slim | uv | 8000 |
| Python Agentic AI | python:3.14-slim | uv + gunicorn | 8000 |
| TypeScript/Fastify / Node 24 | node:24-alpine | npm | 3000 |

### Step 2: Set Up Docker Compose

Read `reference/compose-patterns.md` for:
- Development compose (PostgreSQL 17 + Redis 7)
- Production compose with Docker secrets (`_FILE` env pattern)
- Health check dependency ordering (`condition: service_healthy`)
- Network isolation (internal backend network)
- Resource limits and restart policies

### Step 3: Apply Advanced Patterns (if needed)

Read `reference/advanced-patterns.md` for:
- Build cache mounts (`--mount=type=cache`) for Maven, npm, pip/uv — cuts rebuild time significantly
- Multi-architecture builds (`docker buildx`) for linux/amd64 + linux/arm64
- Distroless runtime images for zero-CVE base
- Build-time secrets (BuildKit `--mount=type=secret`)
- Diagnostics: slow builds, large images, networking failures, hot-reload issues

### Step 4: Review with Checklist

Read `assets/docker-review-checklist.md` before committing any Dockerfile or compose file. Covers 6 categories: optimization, security, compose, image size, dev workflow, networking.

## Reference Files

| File | Content | Load When |
|------|---------|-----------|
| `reference/dockerfiles.md` | Copy-ready multi-stage Dockerfiles + .dockerignore for all 5 stack variants | Writing any new Dockerfile |
| `reference/compose-patterns.md` | Dev compose (PostgreSQL+Redis), production compose with Docker secrets, health checks, networks, resource limits | Writing or reviewing docker-compose files |
| `reference/advanced-patterns.md` | Build cache mounts (all stacks), multi-arch buildx, distroless images, build secrets, diagnostics | Optimizing builds or debugging container issues |
| `assets/docker-review-checklist.md` | 30-item Docker review checklist (6 categories) with stack-specific items | Before committing Dockerfile or compose changes |

## Error Handling

**Build fails with "not found" or permission error**: Check .dockerignore is not excluding required files. Verify COPY paths match actual project structure.

**Image too large (>500MB for Node/Python, >300MB for Java runtime)**: Read `reference/advanced-patterns.md` section "Image Size Optimization" — switch to multi-stage if single-stage, or distroless runtime.

**Container exits immediately**: Check HEALTHCHECK target path matches the actual health endpoint. Verify USER directive comes after all COPY operations. Check CMD vs ENTRYPOINT usage.

**docker-compose: service fails to connect to database**: Verify `depends_on: condition: service_healthy` is set. Verify DATABASE_URL credentials match docker-compose environment values exactly.
Files in this package (5)
  • SKILL.md 5 KB
  • assets/docker-review-checklist.md 5 KB
  • reference/advanced-patterns.md 9 KB
  • reference/compose-patterns.md 8 KB
  • reference/dockerfiles.md 9 KB

Versions

RepositoryScoreLicence
This page · kumaran-is/claude-code-onboarding90MIT
event4u-app/agent-config100MIT
ericrisco/rsc-harness100MIT
atomicbot-ai/atomic-agent100MIT
aleks-spv/sysaiadm_station100AGPL-3.0
companion-inc/feynman100MIT
claude-dev-suite/claude-dev-suite100MIT
greedychipmunk/agent-skills100MIT
poppyszn/dev-pops-skills100MIT

Database snapshot: 13.11.2026 · package version 717001447874 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90docker-patterns
    Container build, security, and caching conventions. Use when editing Dockerfiles, Compose files, build contexts, or .dockerignore.
  • 100docker-compose-generator
    Generates multi-stage Dockerfiles and docker-compose configurations optimized for size, security, and development workflow. Covers common stacks including Node.js, Python, Java, and Go. Triggers on: "create Dockerfile", "docker-compose", "containerize", "docker setup".
  • 100docker-expert
    Expert Docker: Dockerfiles, multi-stage builds, image size/cache optimization, Compose, and container best practices. Trigger keywords: Docker, Dockerfile, container, image, multi-stage, layer cache, docker-compose, .dockerignore, entrypoint, distroless, non-root, healthcheck,…
  • 100docker-expert
    Use when working with Dockerfile, docker-compose.yml, .dockerignore, or multi-stage builds. Build, debug, secure, and optimize Docker 27+ images and Docker Compose services.
  • 100docker-conventions
    Best practices and conventions for Docker, Dockerfiles, docker-compose, and containerization. Covers multi-stage builds, base image selection, layer optimization, .dockerignore, non-root users, CMD vs ENTRYPOINT, health checks, environment configuration, image security scanning,…
  • 100docker-development
    Docker and container development agent skill and plugin for Dockerfile optimization, docker-compose orchestration, multi-stage builds, and container security hardening. Use when: user wants to optimize a Dockerfile, create or improve docker-compose configurations, implement…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.