From glincker-claude-code-marketplace
Generate optimized Dockerfiles and docker-compose.yml with best practices and multi-stage builds
npx claudepluginhub joshuarweaver/cascade-code-general-misc-4 --plugin glincker-claude-code-marketplaceThis skill is limited to using the following tools:
Generate production-ready Dockerfiles and docker-compose.yml files by analyzing your project. Follows best practices, optimizes image size, and includes security hardening.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Generate production-ready Dockerfiles and docker-compose.yml files by analyzing your project. Follows best practices, optimizes image size, and includes security hardening.
Detect project type:
Use Glob to find:
- package.json → Node.js
- requirements.txt/pyproject.toml → Python
- go.mod → Go
- Cargo.toml → Rust
- pom.xml/build.gradle → Java
Analyze dependencies:
Use Read to examine:
- Runtime dependencies
- Build dependencies
- Environment requirements
- Port requirements
Generate optimized multi-stage Dockerfile:
# Example for Node.js
# Stage 1: Dependencies
FROM node:20-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
# Stage 2: Build
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 3: Production
FROM node:20-alpine AS runner
WORKDIR /app
# Security: Run as non-root user
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodejs /app/dist ./dist
USER nextjs
EXPOSE 3000
CMD ["node", "dist/index.js"]
Best practices applied:
Create docker-compose.yml for multi-service setups:
version: '3.9'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://user:pass@db:5432/myapp
depends_on:
db:
condition: service_healthy
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pass
- POSTGRES_DB=myapp
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: redis:7-alpine
ports:
- "6379:6379"
restart: unless-stopped
volumes:
postgres_data:
.dockerignore:
node_modules
npm-debug.log
.git
.env
*.md
.vscode
.idea
coverage
.DS_Store
docker-compose.dev.yml (development overrides):
version: '3.9'
services:
app:
build:
target: builder
volumes:
- .:/app
- /app/node_modules
environment:
- NODE_ENV=development
command: npm run dev
# Use npm ci for faster, reproducible builds
RUN npm ci --only=production
# Leverage layer caching
COPY package*.json ./
RUN npm ci
COPY . .
# Use pip with cache mount
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r requirements.txt
# Use multi-stage for smaller images
FROM python:3.11-slim
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
# Multi-stage with scratch base
FROM golang:1.21-alpine AS builder
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM scratch
COPY --from=builder /app/app /app
CMD ["/app"]
User: "Generate Docker setup for my MERN app"
Generated:
User: "Create Docker Compose for microservices"
Generated:
latest tagsGLINCKER Team