ln-731-docker-generator

Generates Docker and docker-compose configuration for multi-container development

16 stars

Best use case

ln-731-docker-generator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generates Docker and docker-compose configuration for multi-container development

Teams using ln-731-docker-generator should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ln-731-docker-generator/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/devops/ln-731-docker-generator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ln-731-docker-generator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ln-731-docker-generator Compares

Feature / Agentln-731-docker-generatorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generates Docker and docker-compose configuration for multi-container development

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

> **Paths:** File paths (`shared/`, `references/`, `../ln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

# ln-731-docker-generator

**Type:** L3 Worker
**Category:** 7XX Project Bootstrap
**Parent:** ln-730-devops-setup

Generates production-ready Docker configuration for containerized development.

---

## Purpose & Scope

Creates Docker infrastructure for local development and production:
- **Does**: Generate Dockerfiles, docker-compose, .dockerignore, nginx config
- **Does NOT**: Build images, start containers, manage deployments

---

## Inputs

| Input | Source | Description |
|-------|--------|-------------|
| **Stack Type** | ln-730 coordinator | frontend, backend-dotnet, backend-python |
| **Versions** | Auto-detected | Node.js, .NET, Python versions |
| **Project Name** | Directory name | Used for container naming |
| **Ports** | Defaults or detected | Frontend: 3000, Backend: 5000/8000, DB: 5432 |

---

## Outputs

| File | Purpose | Template |
|------|---------|----------|
| `Dockerfile.frontend` | Frontend build & serve | [dockerfile_frontend.template](references/dockerfile_frontend.template) |
| `Dockerfile.backend` | Backend build & run | [dockerfile_backend_dotnet.template](references/dockerfile_backend_dotnet.template) or [dockerfile_backend_python.template](references/dockerfile_backend_python.template) |
| `docker-compose.yml` | Service orchestration | [docker_compose.template](references/docker_compose.template) |
| `.dockerignore` | Build context exclusions | [dockerignore.template](references/dockerignore.template) |
| `nginx.conf` | Frontend proxy config | [nginx.template](references/nginx.template) |

---

## Workflow

### Phase 1: Input Validation

Validate received configuration from coordinator:
- Check stack type is supported (frontend, backend-dotnet, backend-python)
- Verify versions are valid (Node 18+, .NET 8+, Python 3.10+)
- Confirm project directory exists

**Output**: Validated configuration or error

### Phase 2: Template Selection

Select appropriate templates based on stack:

| Stack | Templates Used |
|-------|----------------|
| **Frontend only** | dockerfile_frontend, nginx, dockerignore |
| **Backend .NET** | dockerfile_backend_dotnet, docker_compose, dockerignore |
| **Backend Python** | dockerfile_backend_python, docker_compose, dockerignore |
| **Full stack .NET** | All of the above (dotnet variant) |
| **Full stack Python** | All of the above (python variant) |

### Phase 3: Variable Substitution

Replace template variables with detected values:

| Variable | Source | Example |
|----------|--------|---------|
| `{{NODE_VERSION}}` | package.json engines or default | 22 |
| `{{DOTNET_VERSION}}` | *.csproj TargetFramework | 9.0 |
| `{{PYTHON_VERSION}}` | pyproject.toml or default | 3.12 |
| `{{PROJECT_NAME}}` | Directory name | my-app |
| `{{DLL_NAME}}` | *.csproj AssemblyName | MyApp.Api.dll |
| `{{FRONTEND_PORT}}` | Default or detected | 3000 |
| `{{BACKEND_PORT}}` | Stack-dependent | 5000 (.NET), 8000 (Python) |
| `{{BACKEND_HOST}}` | Service name | backend |
| `{{CMD}}` | Framework-dependent | `["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]` (FastAPI) or `["gunicorn", "--bind", "0.0.0.0:8000", "{{PROJECT_NAME}}.wsgi:application"]` (Django) |

### Phase 4: File Generation

Generate files from templates:
1. Check if file already exists (warn before overwrite)
2. Apply variable substitution
3. Write file to appropriate location
4. Validate syntax where possible

**File Locations**:
- `Dockerfile.frontend` -> `src/frontend/Dockerfile`
- `Dockerfile.backend` -> project root
- `docker-compose.yml` -> project root
- `.dockerignore` -> project root
- `nginx.conf` -> `src/frontend/nginx.conf`

---

## Supported Stacks

### Frontend: React/Vite + Nginx

**Requirements**:
- package.json with build script
- Vite or CRA configuration

**Generated**:
- Multi-stage Dockerfile (builder + nginx)
- Nginx config with SPA routing and API proxy

### Backend: .NET 8/9

**Requirements**:
- *.sln file in root
- *.csproj with TargetFramework

**Generated**:
- Multi-stage Dockerfile (SDK build + ASP.NET runtime)
- Health check endpoint configuration

### Backend: Python (FastAPI/Django)

**Requirements**:
- requirements.txt or pyproject.toml

**Generated**:
- Multi-stage Dockerfile (builder + slim runtime)
- uvicorn (FastAPI) or gunicorn (Django) entrypoint

---

## Security & Performance Best Practices

All generated files follow these guidelines:

| Practice | Implementation |
|----------|----------------|
| **Non-root user** | Create and use appuser (UID 1001) |
| **Minimal images** | Alpine/slim variants |
| **Multi-stage builds** | Exclude build tools from runtime |
| **No secrets** | Use environment variables, not hardcoded |
| **Health checks** | Built-in HEALTHCHECK instructions (wget/curl) |
| **Specific versions** | Pin base image versions (e.g., nginx:1.27-alpine) |
| **Non-interactive mode** | ARG DEBIAN_FRONTEND=noninteractive |
| **Layer caching** | Copy dependency files first, source code last |
| **BuildKit cache** | Use `--mount=type=cache` for pip |
| **Python optimization** | PYTHONDONTWRITEBYTECODE=1, PYTHONUNBUFFERED=1 |

---

## Quality Criteria

Generated files must meet:
- [ ] `docker-compose config` validates without errors
- [ ] All base images use specific versions (not `latest`)
- [ ] Non-root user configured in all Dockerfiles
- [ ] Health checks present for all services
- [ ] .dockerignore excludes all sensitive files
- [ ] No hardcoded secrets or passwords

---

## Critical Notes

1. **Version Detection**: Use detected versions from coordinator, not hardcoded defaults.
2. **Idempotent**: Check file existence before writing. Warn if overwriting.
3. **Template-based**: All generation uses templates from references/. Do NOT hardcode file contents.
4. **Security First**: Every generated file must follow security best practices.

---

## Reference Files

| File | Purpose |
|------|---------|
| [dockerfile_frontend.template](references/dockerfile_frontend.template) | React/Vite multi-stage Dockerfile |
| [dockerfile_backend_dotnet.template](references/dockerfile_backend_dotnet.template) | .NET multi-stage Dockerfile |
| [dockerfile_backend_python.template](references/dockerfile_backend_python.template) | Python multi-stage Dockerfile |
| [docker_compose.template](references/docker_compose.template) | docker-compose.yml template |
| [dockerignore.template](references/dockerignore.template) | .dockerignore template |
| [nginx.template](references/nginx.template) | Nginx configuration |

---

**Version:** 1.2.0
**Last Updated:** 2026-01-21

Related Skills

production-dockerfile

16
from diegosouzapw/awesome-omni-skill

Generate production-ready Dockerfiles with multi-stage builds, security best practices, and optimization. Use when containerizing Python applications for production deployment.

k8s-yaml-generator

16
from diegosouzapw/awesome-omni-skill

Comprehensive toolkit for generating, validating, and managing Kubernetes YAML resources. Use this skill when creating Kubernetes manifests (Deployments, Services, ConfigMaps, StatefulSets, etc.), working with Custom Resource Definitions (CRDs), or generating production-ready K8s configurations.

k8s-manifest-generator

16
from diegosouzapw/awesome-omni-skill

Create production-ready Kubernetes manifests for Deployments, Services, ConfigMaps, and Secrets following best practices and security standards. Use when generating Kubernetes YAML manifests, creat...

jenkinsfile-generator

16
from diegosouzapw/awesome-omni-skill

Comprehensive toolkit for generating best practice Jenkinsfiles for both Declarative and Scripted pipeline syntaxes. Use this skill when creating new Jenkins pipelines, implementing CI/CD workflows.

iac-diagram-generator

16
from diegosouzapw/awesome-omni-skill

Analyzes Infrastructure as Code files (Terraform, CloudFormation, Kubernetes, Docker Compose) and generates visual architecture diagrams. Use when analyzing infrastructure code, designing cloud architectures, or when the user requests architecture diagrams from IaC.

featbit-deployment-docker

16
from diegosouzapw/awesome-omni-skill

Expert guidance for deploying FeatBit with Docker Compose across three tiers - Standalone (PostgreSQL only), Standard (PostgreSQL/MongoDB + Redis), and Professional (+ ClickHouse + Kafka). Use when user mentions "docker-compose", "deploy with Docker", "standalone vs standard vs pro", works with docker-compose.yml files, or asks about container configuration, environment variables, or production Docker setup.

dockerfile-optimization

16
from diegosouzapw/awesome-omni-skill

Optimize Dockerfiles for smaller images, faster builds, better caching, and security. Use this skill when writing, reviewing, or debugging Dockerfiles.

Docker Hub Automation

16
from diegosouzapw/awesome-omni-skill

Automate Docker Hub tasks via Rube MCP (Composio): repositories, images, tags, and container registry management. Always search tools first for current schemas.

docker

16
from diegosouzapw/awesome-omni-skill

Docker y Compose. Proyecto usa este skill; contenido canónico en .ai-system.

docker-workflow

16
from diegosouzapw/awesome-omni-skill

Comprehensive Docker containerization workflow covering multi-stage builds, docker-compose orchestration, image optimization, debugging, and production best practices. Use when containerizing applications, setting up development environments, or deploying with Docker.

docker-vigil-orchestration

16
from diegosouzapw/awesome-omni-skill

Docker Compose orchestration for Vigil Guard v2.0.0 microservices (11 services). Use when deploying services, managing containers, troubleshooting Docker network issues, working with vigil-net, configuring docker-compose.yml, handling service dependencies, or working with 3-branch detection services (heuristics, semantic, prompt-guard).

docker-to-k8s-manifests

16
from diegosouzapw/awesome-omni-skill

Automatically generate optimized Kubernetes deployment manifests from Dockerfile and docker-compose configurations with proper resource limits and health checks.