skills/docker-containerization/SKILL.md
Use when creating Dockerfiles, docker-compose configs, optimizing container images, or setting up containerized development environments
npx skillsauth add kienbui1995/magic-powers docker-containerizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Containers should be small, secure, and reproducible. A good Dockerfile builds fast, runs lean, and has no secrets baked in.
# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
# Stage 2: Runtime
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
USER node
EXPOSE 3000
CMD ["node", "dist/index.js"]
alpine or distroless, not ubuntupackage.json before source code (cache deps layer)USER node or USER appusernode_modules, .git, .env, test filesnode:20.11-alpine not node:latestHEALTHCHECK CMD curl -f http://localhost:3000/health| Stack | Target Size | |-------|-------------| | Node.js | <150MB | | Python | <200MB | | Go | <20MB (static binary) | | Java | <200MB (JRE slim) |
services:
app:
build: .
ports: ["3000:3000"]
volumes: ["./src:/app/src"] # hot reload
env_file: .env
depends_on:
db: { condition: service_healthy }
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: app
POSTGRES_PASSWORD: dev
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
docker scout or trivycontent-media
Use when designing for XR (AR/VR/MR), choosing interaction modes, or adapting 2D UI patterns for spatial computing
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment
development
Use when you have a spec or requirements for a multi-step task, before touching code
development
Use when executing a structured workflow — select and run a feature, bugfix, refactor, research, or incident template with correct agent and model assignments per phase.