This walks you through containerizing Node.js apps with Docker, from basic Dockerfiles to multi-stage builds and production deployments. You'll learn how to set up Docker Compose for multi-container stacks with Postgres and Redis, optimize images down from 1GB to 180MB using Alpine, and handle the gotchas like proper signal handling and non-root users. The progression makes sense: start with a simple container, move to compose files, then tackle CI/CD with GitHub Actions. Honestly, the multi-stage build pattern shown here should be your default. If you're still deploying Node apps without containers or your Docker setup is just copy-pasted from Stack Overflow, this gives you the full picture.

skills.sh installs
525
GitHub stars
2
last updated
Aug 21, 2026

Install

$ npx -y skills add pluginagentmarketplace/custom-plugin-nodejs --skill docker-deployment --agent claude-code

Installs into .claude/skills of the current project.

Files

Docker Deployment Skill

Master containerizing and deploying Node.js applications with Docker for consistent, portable deployments.

Quick Start

Dockerize Node.js app in 3 steps:

  1. Create Dockerfile - Define container image
  2. Build Image - docker build -t myapp .
  3. Run Container - docker run -p 3000:3000 myapp

Core Concepts

Basic Dockerfile

FROM node:18-alpine

WORKDIR /app

COPY package*.json ./
RUN npm ci --only=production

COPY . .

EXPOSE 3000

CMD ["node", "src/index.js"]

Multi-Stage Build (Optimized)

# Build stage
FROM node:18-alpine AS builder

WORKDIR /app

COPY package*.json ./
RUN npm ci --only=production

COPY . .

# Production stage
FROM node:18-alpine

WORKDIR /app

# Copy from builder
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app .

# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
    adduser -S nodejs -u 1001

USER nodejs

EXPOSE 3000

HEALTHCHECK --interval=30s --timeout=3s \
  CMD node healthcheck.js || exit 1

CMD ["node", "src/index.js"]

Learning Path

Sponsors

Details

Repository
github.com/pluginagentmarketplace/custom-plugin-nodejs
Categories
DevOps & CI/CD, Release Management, Mobile Development
First seen
Jun 3, 2026

More from pluginagentmarketplace/custom-plugin-nodejs

All 4
1aj-geddes avatarprometheus-monitoringaj-geddes/useful-ai-promptsSet up Prometheus monitoring for applications with custom metrics, scraping configurations, and service discovery. Use when implementing time-series metrics col516skills.sh installs
2bobmatnyc avatargolang-observability-opentelemetrybobmatnyc/claude-mpm-skillsInstrumenting Go applications with OpenTelemetry for distributed tracing, Prometheus for metrics, and structured logging with slog421skills.sh installs
3levnikolaevich avatarln-115-devops-docs-creatorlevnikolaevich/claude-code-skillsCreates infrastructure.md and runbook.md (Docker-conditional). Use for DevOps documentation in any project.384skills.sh installs
4bobmatnyc avatarvercel-observabilitybobmatnyc/claude-mpm-skillsVercel observability for Web Analytics, Speed Insights, logs, tracing, alerts, and observability tooling. Use when monitoring performance or debugging productio345skills.sh installs
5levnikolaevich avatarln-627-observability-auditorlevnikolaevich/claude-code-skillsChecks structured logging, health checks, metrics collection, request tracing, log levels. Use when auditing observability.316skills.sh installs
6odyssey4me avatargitlabodyssey4me/agent-skillsCreate and manage GitLab issues, merge requests, pipelines, and repositories using the glab CLI. Use when asked to open an MR, review a merge request, check CI/303skills.sh installs