Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
pluginagentmarketplace avatar

Docker Deployment

  • 503 installs
  • 2 repo stars
  • Updated January 7, 2026
  • pluginagentmarketplace/custom-plugin-nodejs

docker-deployment is a Claude Code skill that containerizes Node.js applications with multi-stage Dockerfiles, Docker Compose, non-root users, and health checks for developers who ship portable production deployments.

About

docker-deployment is a pluginagentmarketplace/custom-plugin-nodejs agent skill (sasmp_version 1.3.0) for containerizing and deploying Node.js applications with Docker. The skill walks through a three-step quick start: create a Dockerfile, build with docker build -t myapp, and run with Docker Compose for consistent local and production environments. Guidance covers multi-stage builds for smaller images, non-root container users, health check endpoints, and production optimization patterns. The skill bonds as a PRIMARY_BOND to 01-nodejs-fundamentals for Node.js context. Developers reach for docker-deployment when dockerizing an Express or Node API, standardizing dev-prod parity, or hardening container images before CI/CD deployment.

  • Three-step quick start: Dockerfile → docker build → docker run with port publish
  • Production-oriented multi-stage Dockerfile pattern separating install/build from runtime
  • npm ci --only=production in image layers for deterministic dependency installs
  • Non-root nodejs user (uid 1001) and HEALTHCHECK stub for production hardening
  • Alpine-based node:18 images for smaller attack surface and faster pulls

Docker Deployment by the numbers

  • 503 all-time installs (skills.sh)
  • +7 installs in the week ending Jul 26, 2026 (Skillselion tracking)
  • Ranked #264 of 1,453 DevOps & CI/CD skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 26, 2026 (Skillselion catalog sync)
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-nodejs --skill docker-deployment

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs503
repo stars2
Security audit3 / 3 scanners passed
Last updatedJanuary 7, 2026
Repositorypluginagentmarketplace/custom-plugin-nodejs

How do you dockerize a Node.js app for production?

Containerize a Node.js service with multi-stage images, non-root users, health checks, and Compose so you can ship the same build locally and in prod.

Who is it for?

Node.js backend developers containerizing services who need multi-stage images, Compose orchestration, and production hardening patterns.

Skip if: Non-Node.js applications or teams already standardized on Kubernetes manifests without Docker-based workflows.

When should I use this skill?

A developer asks to dockerize a Node.js app, create a multi-stage Dockerfile, add health checks, or set up Docker Compose for deployment.

What you get

Dockerfile, Docker Compose file, container image, and production-hardened Node.js deployment config

  • Dockerfile
  • docker-compose.yml
  • production container image

By the numbers

  • Defines a 3-step Docker quick start from Dockerfile through docker build
  • Published as sasmp_version 1.3.0 with PRIMARY_BOND to 01-nodejs-fundamentals

Files

SKILL.mdMarkdownGitHub ↗

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

Beginner (1-2 weeks)

  • ✅ Understand Docker basics
  • ✅ Create simple Dockerfile
  • ✅ Build and run containers
  • ✅ Manage volumes and networks

Intermediate (3-4 weeks)

  • ✅ Multi-stage builds
  • ✅ Docker Compose
  • ✅ Environment variables
  • ✅ Health checks

Advanced (5-6 weeks)

  • ✅ Image optimization
  • ✅ Production best practices
  • ✅ Container orchestration
  • ✅ CI/CD integration

Docker Compose

# docker-compose.yml
version: '3.8'

services:
  app:
    build: .
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - DATABASE_URL=postgresql://db:5432/myapp
      - REDIS_URL=redis://redis:6379
    depends_on:
      - db
      - redis
    restart: unless-stopped

  db:
    image: postgres:15-alpine
    environment:
      - POSTGRES_USER=myapp
      - POSTGRES_PASSWORD=secret
      - POSTGRES_DB=myapp
    volumes:
      - postgres-data:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine
    volumes:
      - redis-data:/data

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - app

volumes:
  postgres-data:
  redis-data:

Docker Compose Commands

# Start services
docker-compose up -d

# View logs
docker-compose logs -f app

# Stop services
docker-compose down

# Rebuild images
docker-compose up -d --build

# Scale services
docker-compose up -d --scale app=3

.dockerignore

node_modules
npm-debug.log
.git
.gitignore
.env
.env.local
.vscode
*.md
tests
coverage
.github
Dockerfile
docker-compose.yml

Docker Commands

# Build image
docker build -t myapp:latest .

# Run container
docker run -d -p 3000:3000 --name myapp myapp:latest

# View logs
docker logs -f myapp

# Enter container
docker exec -it myapp sh

# Stop container
docker stop myapp

# Remove container
docker rm myapp

# List images
docker images

# Remove image
docker rmi myapp:latest

# Prune unused resources
docker system prune -a

Environment Variables

# In Dockerfile
ENV NODE_ENV=production
ENV PORT=3000

# Or in docker-compose.yml
environment:
  - NODE_ENV=production
  - PORT=3000

# Or from .env file
env_file:
  - .env.production

Volumes for Persistence

services:
  app:
    volumes:
      - ./logs:/app/logs              # Bind mount
      - node_modules:/app/node_modules # Named volume

volumes:
  node_modules:

Health Checks

# In Dockerfile
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
  CMD node healthcheck.js || exit 1
// healthcheck.js
const http = require('http');

const options = {
  host: 'localhost',
  port: 3000,
  path: '/health',
  timeout: 2000
};

const request = http.request(options, (res) => {
  console.log(`STATUS: ${res.statusCode}`);
  process.exit(res.statusCode === 200 ? 0 : 1);
});

request.on('error', (err) => {
  console.log('ERROR:', err);
  process.exit(1);
});

request.end();

Image Optimization

# Use Alpine (smaller base image)
FROM node:18-alpine  # 180MB vs node:18 (1GB)

# Multi-stage build (remove build dependencies)
# Use .dockerignore (exclude unnecessary files)
# npm ci instead of npm install (faster, deterministic)
# Only production dependencies
RUN npm ci --only=production

# Combine RUN commands (fewer layers)
RUN apk add --no-cache git && \
    npm ci && \
    apk del git

Production Best Practices

FROM node:18-alpine

# Don't run as root
RUN addgroup -g 1001 -S nodejs && \
    adduser -S nodejs -u 1001

WORKDIR /app

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

COPY --chown=nodejs:nodejs . .

USER nodejs

# Health check
HEALTHCHECK CMD node healthcheck.js || exit 1

# Use node instead of npm start (better signal handling)
CMD ["node", "src/index.js"]

Docker Hub Deployment

# Login
docker login

# Tag image
docker tag myapp:latest username/myapp:1.0.0
docker tag myapp:latest username/myapp:latest

# Push to Docker Hub
docker push username/myapp:1.0.0
docker push username/myapp:latest

# Pull from Docker Hub
docker pull username/myapp:latest

CI/CD with GitHub Actions

name: Docker Build & Deploy

on:
  push:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - uses: docker/setup-buildx-action@v2

      - uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - uses: docker/build-push-action@v4
        with:
          push: true
          tags: username/myapp:latest
          cache-from: type=gha
          cache-to: type=gha,mode=max

Common Issues & Solutions

Node modules caching

# Cache node_modules layer
COPY package*.json ./
RUN npm ci
COPY . .  # This doesn't rebuild node_modules

Signal handling

# Use node directly (not npm)
CMD ["node", "src/index.js"]

# In app: Handle SIGTERM
process.on('SIGTERM', () => {
  server.close(() => process.exit(0));
});

When to Use

Use Docker deployment when:

  • Need consistent environments (dev, staging, prod)
  • Deploying microservices
  • Want easy scaling and orchestration
  • Using cloud platforms (AWS, GCP, Azure)
  • Implementing CI/CD pipelines

Related Skills

  • Express REST API (containerize APIs)
  • Database Integration (multi-container setup)
  • Testing & Debugging (test in containers)
  • Performance Optimization (optimize images)

Resources

Related skills

How it compares

Choose docker-deployment for Node.js Docker images and Compose; use a Kubernetes or platform-specific skill when orchestration goes beyond container packaging.

FAQ

What does the docker-deployment skill cover for Node.js?

The docker-deployment skill covers multi-stage Dockerfiles, docker build commands, Docker Compose orchestration, non-root users, health checks, and production optimization for Node.js applications. Its quick start follows three steps from Dockerfile creation through image build a

Which Node.js skill is docker-deployment bonded to?

docker-deployment (sasmp_version 1.3.0) has a PRIMARY_BOND to 01-nodejs-fundamentals in the custom-plugin-nodejs marketplace. Agents should apply Node.js fundamentals alongside containerization guidance for consistent service configuration.

Is Docker Deployment safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

DevOps & CI/CDdeployinfra

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.