Deploy Generators

Deployment configurations

Deploy Generators

Generate production-ready deployment configurations based on project analysis.


Usage

/deploy-gen docker [options]
/deploy-gen k8s [options]
/deploy-gen compose [options]

Deployment Types

TypeOutputUse Case
`docker`Dockerfile, .dockerignoreContainer builds
`k8s`Kubernetes manifestsProduction orchestration
`compose`docker-compose.ymlLocal development

Options

OptionDefaultDescription
`--output``./deploy/`Output directory
`--app-name`from package.jsonApplication name
`--port`3000Application port
`--multi-stage`trueUse multi-stage Dockerfile
`--health-check`trueInclude health check endpoints

Process

1. Project Analysis

The generator detects:

  • Runtime (Node.js, Python, Go, Java)
  • Package manager (npm, yarn, pip, go mod)
  • Entry point
  • Build requirements

2. Template Selection

RuntimeTemplate
Node.jsMulti-stage with npm ci
PythonMulti-stage with pip
GoMulti-stage with static binary

3. Configuration Generation

Files are generated with project-specific values.


Docker Output

deploy/
├── Dockerfile           # Multi-stage build
├── .dockerignore        # Exclude dev files
└── docker-build.sh      # Build helper script

Features:

  • Multi-stage build (build → production)
  • Non-root user
  • Health check
  • Proper signal handling
  • Layer caching optimization

Kubernetes Output

deploy/k8s/
├── deployment.yaml      # Pod specification
├── service.yaml         # Service exposure
├── configmap.yaml       # Environment configuration
├── hpa.yaml            # Horizontal Pod Autoscaler
└── kustomization.yaml  # Kustomize base

Features:

  • Resource limits and requests
  • Liveness and readiness probes
  • ConfigMap for environment
  • HPA for auto-scaling
  • Kustomize for environment overlays

Docker Compose Output

deploy/
├── docker-compose.yml       # Service definition
├── docker-compose.dev.yml   # Development overrides
└── .env.example             # Environment template

Examples

# Generate Dockerfile for Node.js project
/deploy-gen docker

# Generate Kubernetes manifests with custom name/port
/deploy-gen k8s --app-name my-api --port 8080

# Generate Docker Compose in current directory
/deploy-gen compose --output ./

# Generate all deployment types
/deploy-gen docker
/deploy-gen k8s
/deploy-gen compose

Template Variables

VariableSource
`{{APP_NAME}}`--app-name or package.json
`{{PORT}}`--port option
`{{NODE_VERSION}}`.nvmrc or latest LTS
`{{PYTHON_VERSION}}`.python-version or 3.11
`{{ENTRY_POINT}}`Detected from project

Security Best Practices

All generated configurations follow security best practices:

  • Non-root user - Containers run as unprivileged user
  • Minimal base images - Alpine or distroless where possible
  • No secrets in images - Environment variables for configuration
  • Read-only filesystem - Where supported
  • Resource limits - Prevent resource exhaustion

CommandDescription
`/project-health-check`Analyze project before deployment
`/security-audit`Security review before production
`/flow-deploy-to-production`Full deployment workflow