docker-compose-generator

Solid

Generates multi-stage Dockerfiles and docker-compose configurations optimized for size, security, and development workflow. Covers common stacks including Node.js, Python, Java, and Go. Triggers on: "create Dockerfile", "docker-compose", "containerize", "docker setup".

DevOps & Infrastructure 10 stars 3 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
35
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Docker Compose Generator ## Instructions ### Step 1: Identify the Stack Ask: 1. What language/runtime? (Node.js, Python, Java, Go, Ruby, .NET) 2. What framework? (Express, FastAPI, Spring Boot, Gin, Rails) 3. What services are needed? (database, cache, message queue, search) 4. Is this for development, production, or both? 5. Any existing Dockerfile to improve? ### Step 2: Generate Multi-Stage Dockerfile Use multi-stage builds to minimize image size: **Node.js example:** ```dockerfile # Stage 1: Dependencies FROM node:20-alpine AS deps WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci --only=production # Stage 2: Build FROM node:20-alpine AS build WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci COPY . . RUN npm run build # Stage 3: Production FROM node:20-alpine AS production RUN addgroup -g 1001 -S appgroup && \ adduser -S appuser -u 1001 -G appgroup WORKDIR /app COPY --from=deps --chown=appuser:appgroup /app/node_modules ./node_modules COPY --from=build --chown=appuser:appgroup /app/dist ./dist COPY --from=build --chown=appuser:appgroup /app/package.json ./ USER appuser EXPOSE 3000 HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \ CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1 CMD ["node", "dist/index.js"] ``` **Python example:** ```dockerfile FROM python:3.12-slim AS base ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 FROM base AS deps WORKDIR /app COPY requirements.txt . RUN p...

Details

Author
timwukp
Repository
timwukp/agent-skills-best-practice
Created
6 months ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

DevOps & Infrastructure Listed

docker-deploy

Use when creating Dockerfiles, docker-compose configs, or containerizing applications. Covers multi-stage builds, image optimization, compose patterns for dev and production, health checks, signal handling, and security hardening.

5 Updated 5 days ago
Sagargupta16
AI & Automation Featured

containerization-assistant

Generate Dockerfiles, Docker Compose configurations, and Kubernetes manifests for containerizing applications. Use when: (1) Creating Dockerfiles for Node.js, Python, Java, Go, or other applications, (2) Setting up multi-service environments with Docker Compose, (3) Generating Kubernetes deployments, services, and ingress configurations, (4) Optimizing container images for production, (5) Implementing containerization best practices. Provides both ready-to-use templates and custom-generated configurations based on project requirements.

252 Updated 3 weeks ago
ArabelaTso
DevOps & Infrastructure Listed

docker

Build small, secure, reproducible container images and compose stacks. Use when writing or reviewing a Dockerfile, debugging a bloated/slow image build, setting up docker-compose for local dev, adding a healthcheck, handling build secrets, or hardening a container (non-root, minimal base). Triggers — "Dockerfile", "docker build", "docker-compose", "containerize", "image is huge", "layer cache", "multi-stage", any `Dockerfile`/`compose.yaml`. Pairs with deployment-cicd (CI builds + registries + k8s — this skill is the image/compose craft), linux-sysadmin (the host), security-web (runtime hardening).

6 Updated yesterday
kouroshez