skills/docker-containerization-node/SKILL.md
To package a Node.js application and its dependencies into a lightweight, portable container image that runs consistently across any environment. Use when: When preparing an application for production deployment; When ensuring development environment consistency; When isolating microservices in a cluster (Kubernetes/ECS).
npx skillsauth add jyjeanne/ai-setup-forge docker-containerization-nodeInstall 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.
To package a Node.js application and its dependencies into a lightweight, portable container image that runs consistently across any environment.
Use multi-stage builds to keep the final production image as small as possible.
# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: Production
FROM node:20-alpine
WORKDIR /app
ENV NODE_ENV=production
# Install only production dependencies
COPY package*.json ./
RUN npm ci --only=production
# Copy built assets from builder stage
COPY --from=builder /app/dist ./dist
# Security: Run as non-root user
USER node
EXPOSE 3000
CMD ["node", "dist/index.js"]
Prevent unnecessary files from bloating the build context.
node_modules
npm-debug.log
dist
.git
.env
Dockerfile
.dockerignore
Simplify local development with linked services.
# docker-compose.yml
services:
app:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
environment:
- DATABASE_URL=postgres://user:pass@db:5432/db
depends_on:
- db
db:
image: postgres:15
environment:
- POSTGRES_PASSWORD=pass
Commands for the CLI.
# Build the image
docker build -t my-app:v1 .
# Run the container
docker run -p 3000:3000 --env-file .env my-app:v1
alpine or slim tags for smaller, more secure images.package.json and install dependencies before copying the rest of the source code to leverage Docker layer caching..env files or hardcoded secrets in the image. Use environment variables at runtime.A production-ready Dockerfile that produces a minimal, secure image containing only the necessary runtime files.
development
Generate breadboard circuit mockups and visual diagrams using HTML5 Canvas drawing techniques. Use when asked to create circuit layouts, visualize electronic component placements, draw breadboard diagrams, mockup 6502 builds, generate retro computer schematics, or design vintage electronics projects. Supports 555 timers, W65C02S microprocessors, 28C256 EEPROMs, W65C22 VIA chips, 7400-series logic gates, LEDs, resistors, capacitors, switches, buttons, crystals, and wires.
development
Apply lean thinking to UX: hypothesis-driven design, collaborative sketching, and rapid experiments instead of heavy deliverables. Use when the user mentions "Lean UX", "design hypothesis", "UX experiment", "collaborative design", or "outcome over output". Covers hypothesis statements, MVPs for UX, and cross-functional collaboration. For Build-Measure-Learn, see lean-startup. For usability audits, see ux-heuristics.
development
Design MVPs, validated learning experiments, and pivot-or-persevere decisions using Build-Measure-Learn. Use when the user mentions "MVP scope", "validated learning", "pivot or persevere", "vanity metrics", or "test assumptions". Covers innovation accounting and actionable metrics. For 5-day prototype testing, see design-sprint. For customer motivation analysis, see jobs-to-be-done.
tools
Instrument, trace, evaluate, and monitor LLM applications and AI agents with LangSmith. Use when setting up observability for LLM pipelines, running offline or online evaluations, managing prompts in the Prompt Hub, creating datasets for regression testing, or deploying agent servers. Triggers on: langsmith, langchain tracing, llm tracing, llm observability, llm evaluation, trace llm calls, @traceable, wrap_openai, langsmith evaluate, langsmith dataset, langsmith feedback, langsmith prompt hub, langsmith project, llm monitoring, llm debugging, llm quality, openevals, langsmith cli, langsmith experiment, annotate llm, llm judge.