aj-geddes avatar

Docker Containerization

This one walks you through building production-ready Docker containers with multi-stage builds, security hardening, and image optimization. You'll get concrete examples for Node.js, Python, Java, and Go apps, plus reference guides on dockerignore patterns, compose setups, and running as non-root users. The quick start shows a solid multi-stage Node build that actually demonstrates the patterns instead of just talking about them. Most useful when you're past basic containerization and need to ship something secure and lean, or when you're tired of bloated images with root access everywhere. The security and optimization sections cover the stuff that's easy to skip but painful to fix later.

skills.sh installs
681
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill docker-containerization --agent claude-code

Installs into .claude/skills of the current project.

Files

Docker Containerization

Table of Contents

Overview

Build production-ready Docker containers following best practices for security, performance, and maintainability.

When to Use

  • Containerizing applications for deployment
  • Creating Dockerfiles for new services
  • Optimizing existing container images
  • Setting up development environments
  • Building CI/CD container pipelines
  • Implementing microservices

Quick Start

Minimal working example:

# Multi-stage build for Node.js application
# Stage 1: Build
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build

# Stage 2: Production
FROM node:18-alpine
WORKDIR /app
# Copy only production dependencies and built files
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY package*.json ./

# Security: Run as non-root user
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
USER nodejs

EXPOSE 3000
CMD ["node", "dist/index.js"]

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Security, DevOps & CI/CD, AI & Agent Building, Mobile Development
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258

Recommended

More Security
1martinholovsky avatarcicd-expertmartinholovsky/claude-skills-generatorElite CI/CD pipeline engineer specializing in GitHub Actions, GitLab CI, Jenkins automation, secure deployment strategies, and supply chain security. Expert in 648skills.sh installs
2aj-geddes avataraws-s3-managementaj-geddes/useful-ai-promptsManage S3 buckets with versioning, encryption, access control, lifecycle policies, and replication. Use for object storage, static sites, and data lakes.595skills.sh installs
3googleworkspace avatargws-alertcentergoogleworkspace/cliGoogle Workspace Alert Center: Manage Workspace security alerts.570skills.sh installs
4get-convex avatarauth-setupget-convex/agent-skillsSet up Convex authentication with proper user management, identity mapping, and access control patterns. Use when implementing auth flows.516skills.sh installs
5libukai avatarvscode-httpyac-configlibukai/awesome-agent-skillsConfigure VSCode with httpYac for API testing and automation. This skill should be used specifically when converting API documentation to executable .http files513skills.sh installs
6aj-geddes avatarapi-gateway-configurationaj-geddes/useful-ai-promptsConfigure API gateways for routing, authentication, rate limiting, and request/response transformation. Use when deploying microservices, setting up reverse pro508skills.sh installs