- Home
- Skills
- DevOps & Cloud
- docker-production-pro
More screenshots
Works with the AI Agents you already use
Docker Production Pro
Generate ultra-lean (<100MB), secure multi-stage Dockerfiles and compose setups with optimized layer caching.
$7
docker-production-pro
Example session with this skill installed
Dockerize my Node.js Express API. I use pnpm and need to connect to a Postgres database. Make sure it is secure and small for production.
- Read your context and instructions
- Compiled the docker-production-pro
I have analyzed your Node.js Express stack. I've implemented a multi-stage build using node:20-bookworm-slim to minimize size, configured pnpm with store pruning, and set up a non-root user for execution.
Production Configuration
# Stage 1: Builder
FROM node:20-bookworm-slim AS builder
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
COPY pnpm-lock.yaml package.json ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build
# Stage 2: Runtime
FROM node:20-bookworm-slim
RUN groupadd -g 10001 appgroup && \
useradd -u 10001 -g appgroup -s /bin/sh -m appuser
WORKDIR /app
COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
COPY --from=builder --chown=appuser:appgroup /app/node_modules ./node_modules
COPY --from=builder --chown=appuser:appgroup /app/package.json ./package.json
USER appuser
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s \
CMD node -e "fetch('http://localhost:3000/health').then(r => r.ok ? process.exit(0) : process.exit(1))"
CMD ["node", "dist/index.js"]
# docker-compose.yml
version: '3.8'
services:
api:
build: .
restart: always
environment:
- DATABASE_URL=postgres://user:pass@db:5432/app
depends_on:
db:
condition: service_healthy
networks:
- backend
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
db:
image: postgres:16-alpine
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d app"]
interval: 10s
timeout: 5s
retries: 5
networks:
- backend
volumes:
- pgdata:/var/lib/postgresql/data
networks:
backend:
driver: bridge
volumes:
pgdata:
Next steps
- Create a
.dockerignorefile containingnode_modules,.git, and.env. - Run
docker compose up --build -dto start the stack. - Check the image size using
docker imagesto verify the slim footprint.
Connects securely to your tools. The creator never sees your data.
About this skill
The Problem
AI coding agents frequently generate bloated, unoptimized, and insecure Dockerfiles. They typically result in 1.5GB+ container images, broken layer caching that forces 10-minute rebuilds, missing healthchecks, and dangerous root-user execution that exposes your infrastructure to vulnerabilities.
What Docker Production Pro Does
- Ultra-Lean Multi-Stage Builds: Generates minimal runtime images (often <100MB) using Alpine or Distroless bases, slashing deployment times and bandwidth costs.
- Deterministic Layer Caching: Structures dependency installation and code copies perfectly so rebuilds take seconds instead of minutes.
- Zero-Trust Security Hardening: Enforces non-root users, drops unnecessary Linux capabilities, and generates bulletproof
.dockerignorefiles to prevent secret leakage. - Production-Ready Compose & Healthchecks: Crafts resilient
docker-compose.ymlconfigs with healthchecks, graceful shutdown handling, and resource limits.
Supported Stacks
Works flawlessly across Python (FastAPI, Django, Flask), Node.js / Bun / Next.js, Go, Rust, and PostgreSQL / Redis architectures in Claude Code, Cursor, and Codex.
Does not support Windows-based containers. Requires existing application code or a dependency manifest to generate accurate build stages.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
- Software
Python
Permissions
What's inside
Frequently Asked Questions
New in DevOps & Cloud
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.