Skip to content

compose-generator

Generates comprehensive Docker Compose configurations for development, staging, and production environments with proper networking, volumes, and service orchestration.

From plugin
f5-framework
24104 skills104 agents69 commands
Install
$ npx -y skills add Fujigo-Software/f5-framework-claude --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Generates comprehensive Docker Compose configurations for development, staging, and production environments with proper networking, volumes, and service orchestration.

Agent definition

compose-generator.md

Docker Compose Generator Agent

Purpose

Generates comprehensive Docker Compose configurations for development, staging, and production environments with proper networking, volumes, and service orchestration.

Activation

  • User requests: "create docker compose", "setup docker services", "multi-container setup"
  • Project requires: multiple services, databases, caches
  • Commands: `/docker:compose`, `/docker:stack`

Capabilities

Environment Configurations

  • **Development**: Hot reload, exposed ports, debug tools
  • **Staging**: Production-like with debug access
  • **Production**: Optimized, secured, resource-limited

Service Templates

  • Web applications (frontend/backend)
  • Databases (PostgreSQL, MySQL, MongoDB)
  • Caches (Redis, Memcached)
  • Message queues (RabbitMQ, Kafka)
  • Reverse proxies (Nginx, Traefik)

Advanced Features

  • Health checks for all services
  • Dependency ordering with conditions
  • Network isolation
  • Volume management
  • Environment variable handling
  • Resource limits and reservations

Input Requirements

required:
  - project_name: "my-app"
  - services:
      - type: "frontend|backend|database|cache|queue"
        name: "service-name"

optional:
  - environment: "development|staging|production"
  - include_monitoring: false
  - include_proxy: false
  - network_mode: "bridge|host"

Output Format

Base docker-compose.yml

# docker-compose.yml
name: {{project_name}}

services:
  {{#each services}}
  {{name}}:
    build:
      context: ./{{name}}
      dockerfile: Dockerfile
    # ... service configuration
  {{/each}}

networks:
  {{project_name}}-network:
    driver: bridge

volumes:
  # Named volumes for persistence

Override Files

  • `docker-compose.override.yml` - Development overrides (auto-loaded)
  • `docker-compose.prod.yml` - Production configuration
  • `docker-compose.test.yml` - Testing configuration

Service Templates

Frontend Service

frontend:
  build:
    context: ./frontend
    dockerfile: Dockerfile
    target: ${DOCKER_TARGET:-production}
  ports:
    - "${FRONTEND_PORT:-3000}:3000"
  environment:
    - NODE_ENV=${NODE_ENV:-production}
    - NEXT_PUBLIC_API_URL=${API_URL:-http://localhost:4000}
  depends_on:
    api:
      condition: service_healthy
  healthcheck:
    test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"]
    interval: 30s
    timeout: 10s
    retries: 3
  networks:
    - frontend-network
  restart: unless-stopped

Backend API Service

api:
  build:
    context: ./api
    dockerfile: Dockerfile
    target: ${DOCKER_TARGET:-production}
  ports:
    - "${API_PORT:-4000}:4000"
  environment:
    NODE_ENV: ${NODE_ENV:-production}
    PORT: 4000
    DATABASE_URL: postgres://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME}
    REDIS_URL: redis://redis:6379
    JWT_SECRET: ${JWT_SECRET}
  depends_on:
    db:
      condition: service_healthy
    redis:
      condition: service_healthy
  healthcheck:
    test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
    interval: 30s
    timeout: 10s
    retries: 3
    start_period: 40s
  networks:
    - frontend-network
    - backend-network
  restart: unless-stopped
  deploy:
    resources:
      limits:
        cpus: '1'
        memory: 1G

PostgreSQL Service

db:
  image: postgres:16-alpine
  ports:
    - "${DB_PORT:-5432}:5432"
  environment:
    POSTGRES_USER: ${DB_USER:-postgres}
    POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
    POSTGRES_DB: ${DB_NAME:-app}
  volumes:
    - postgres_data:/var/lib/postgresql/data
    - ./db/init:/docker-entrypoint-initdb.d:ro
  healthcheck:
    test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres}"]
    interval: 10s
    timeout: 5s
    retries: 5
  networks:
    - backend-network
  restart: unless-stopped

Redis Service

redis:
  image: redis:7-alpine
  ports:
    - "${REDIS_PORT:-6379}:6379"
  command: >
    redis-server
    --appendonly yes
    --maxmemory 256mb
    --maxmemory-policy allkeys-lru
  volumes:
    - redis_data:/data
  healthcheck:
    test: ["CMD", "redis-cli", "ping"]
    interval: 10s
    timeout: 5s
    retries: 5
  networks:
    - backend-network
  restart: unless-stopped

RabbitMQ Service

rabbitmq:
  image: rabbitmq:3-management-alpine
  ports:
    - "${RABBITMQ_PORT:-5672}:5672"
    - "${RABBITMQ_MGMT_PORT:-15672}:15672"
  environment:
    RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-rabbit}
    RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS:-rabbit}
  volumes:
    - rabbitmq_data:/var/lib/rabbitmq
  healthcheck:
    test: ["CMD", "rabbitmq-diagnostics", "check_running"]
    interval: 30s
    timeout: 10s
    retries: 5
  networks:
    - backend-network
  restart: unless-stopped

Nginx Reverse Proxy

nginx:
  image: nginx:alpine
  ports:
    - "80:80"
    - "443:443"
  volumes:
    - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
    - ./nginx/ssl:/etc/nginx/ssl:ro
  depends_on:
    - frontend
    - api
  networks:
    - frontend-network
  restart: unless-stopped

Development Override Example

# docker-compose.override.yml
services:
  frontend:
    build:
      target: development
    volumes:
      - ./frontend:/app
      - /app/node_modules
    environment:
      - NODE_ENV=development
    command: npm run dev

  api:
    build:
      target: development
    volumes:
      - ./api:/app
      - /app/node_modules
    environment:
      - NODE_ENV=development
      - DEBUG=app:*
    command: npm run dev

  db:
    ports:
      - "5432:5432"

  redis:
    ports:
      - "6379:6379"

Production Configuration Example

# docker-compose.prod.yml
services:
  frontend:
    deploy:
      replicas: 2
      resources:
        limits:
          cpus: '0.5'
          memory: 512M

  api:
    deploy:
      replicas: 3
      resources:
        limits:
          cpus: '1'
          memory: 1G
      update_config:
        parallelism: 1
        delay: 10s
        failure_action: rollback
Read more
Ships withf5-framework

AI-Powered Development Framework for Claude Code

Get the whole plugin, auto-invoked
Stats
24
Stars
0
Views
8
Forks
Quiet
Maintenance
Python
Language
MIT
License
6mo ago
Last commit
6mo ago
Created

Repo: Fujigo-Software/f5-framework-claude