create-docker-supervisor-config

Templates and examples to generate Supervisor configuration for Docker PHP containers, creating process management setups for workers, schedulers, and multi-process scenarios.

Last repository push
GitHub Stars
109
Forks
26
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "create-docker-supervisor-config" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-6d71792a38d3e7305eca19de8794c7e41bed8d56a9fa639d220751ffe6c5af0a. Verify the upstream source and version against https://github.com/dykyi-roman/awesome-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Templates and examples to generate Supervisor configuration for Docker PHP containers, creating process management setups for workers, schedulers, and multi-process scenarios.

0 Downloads

Introduction source: third_party · dykyi-roman · 0.0.1 Reference

SkillPi interpretation

Tasks
Generates Supervisor configuration for Docker PHP containers. Creates process management configs for workers, schedulers, and multi-process setups.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: create-docker-supervisor-config
description: Generates Supervisor configuration for Docker PHP containers. Creates process management configs for workers, schedulers, and multi-process setups.

Docker Supervisor Configuration Generator

Generates Supervisor configurations for managing multiple processes in PHP Docker containers.

Generated Files

docker/supervisor/
  supervisord.conf            # Main Supervisor configuration
  conf.d/php-fpm.conf         # PHP-FPM program definition
  conf.d/worker.conf          # Queue worker program definition
  conf.d/scheduler.conf       # Scheduler program definition

Main supervisord.conf

; supervisord.conf
[supervisord]
nodaemon=true
user=root
logfile=/var/log/supervisor/supervisord.log
logfile_maxbytes=10MB
logfile_backups=3
loglevel=info
pidfile=/var/run/supervisord.pid

[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700

[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock

[include]
files=/etc/supervisor/conf.d/*.conf

PHP-FPM Program

; conf.d/php-fpm.conf
[program:php-fpm]
command=php-fpm --nodaemonize
autostart=true
autorestart=true
priority=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stopwaitsecs=30
stopsignal=QUIT

Queue Worker Program (Multiple Instances)

; conf.d/worker.conf
; Runs multiple worker instances via numprocs
[program:worker]
process_name=%(program_name)s_%(process_num)02d
command=php bin/console messenger:consume async --memory-limit=128M --time-limit=3600 --limit=1000 -vv
numprocs=2
autostart=true
autorestart=true
priority=20
startsecs=5
startretries=3
stopwaitsecs=60
stopsignal=TERM
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

Scheduler Program (Cron-like)

; conf.d/scheduler.conf
[program:scheduler]
command=/bin/bash -c "while true; do php bin/console app:scheduler:run >> /var/log/scheduler.log 2>&1; sleep 60; done"
autostart=true
autorestart=true
priority=30
startsecs=0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

Symfony Messenger Worker Configuration

; conf.d/messenger-worker.conf
; Symfony Messenger — multiple transports with different priorities

[program:messenger-async]
process_name=%(program_name)s_%(process_num)02d
command=php bin/console messenger:consume async --memory-limit=128M --time-limit=3600 -vv
numprocs=2
autostart=true
autorestart=true
priority=20
startsecs=5
startretries=3
stopwaitsecs=60
stopsignal=TERM
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:messenger-priority]
process_name=%(program_name)s_%(process_num)02d
command=php bin/console messenger:consume priority --memory-limit=256M --time-limit=3600 -vv
numprocs=1
autostart=true
autorestart=true
priority=15
startsecs=5
startretries=3
stopwaitsecs=120
stopsignal=TERM
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:messenger-failed-retry]
command=/bin/bash -c "while true; do php bin/console messenger:failed:retry --force --limit=10 2>&1; sleep 300; done"
autostart=true
autorestart=true
priority=25
startsecs=0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

Laravel Queue Worker Configuration

; conf.d/laravel-worker.conf

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:work redis --queue=high,default,low --memory=128 --timeout=60 --tries=3 --max-jobs=1000 --max-time=3600 --sleep=3
numprocs=2
autostart=true
autorestart=true
priority=20
startsecs=5
startretries=3
stopwaitsecs=60
stopsignal=TERM
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:laravel-scheduler]
command=/bin/bash -c "while true; do php artisan schedule:run >> /dev/null 2>&1; sleep 60; done"
autostart=true
autorestart=true
priority=30
startsecs=0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:laravel-horizon]
command=php artisan horizon
autostart=true
autorestart=true
priority=15
startsecs=10
stopwaitsecs=30
stopsignal=TERM
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

Dockerfile Additions for Supervisor

# ─── Supervisor Installation ────────────────────────────
# Alpine-based image
RUN apk add --no-cache supervisor

# Debian-based image
# RUN apt-get update && apt-get install -y supervisor && rm -rf /var/lib/apt/lists/*

# Create directories
RUN mkdir -p /var/log/supervisor /etc/supervisor/conf.d

# Copy Supervisor configuration
COPY docker/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY docker/supervisor/conf.d/ /etc/supervisor/conf.d/

# Start Supervisor as the main process
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

Docker Compose with Supervisor

services:
  # All-in-one container: PHP-FPM + Worker + Scheduler
  app:
    build:
      context: .
      dockerfile: Dockerfile
    command: ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
    volumes:
      - ./docker/supervisor/conf.d:/etc/supervisor/conf.d:ro
    environment:
      - APP_ENV=prod

  # Alternative: Separate containers (recommended for production)
  web:
    build: .
    command: ["php-fpm", "--nodaemonize"]

  worker:
    build: .
    command: ["php", "bin/console", "messenger:consume", "async", "--memory-limit=128M", "-vv"]
    deploy:
      replicas: 2

  scheduler:
    build: .
    command: ["/bin/bash", "-c", "while true; do php bin/console app:scheduler:run; sleep 60; done"]

Process Group Management

; Group workers for batch control
[group:workers]
programs=messenger-async,messenger-priority
priority=20

; supervisorctl commands:
; supervisorctl start workers:*
; supervisorctl stop workers:*
; supervisorctl restart workers:*
; supervisorctl status

Generation Instructions

  1. Identify processes needed:

    • PHP-FPM (web requests)
    • Queue workers (Symfony Messenger / Laravel Queue)
    • Scheduler (cron replacement)
    • Custom daemons
  2. Choose deployment model:

    • All-in-one (Supervisor manages all): simpler, good for small projects
    • Separate containers (one process each): recommended for production
  3. Generate configurations:

    • Main supervisord.conf
    • Per-process conf.d/ files
    • Dockerfile additions
  4. Tune parameters:

    • numprocs for worker concurrency
    • memory-limit and time-limit for workers
    • stopwaitsecs for graceful shutdown
    • startretries for resilience

Usage

Provide:

  • Framework (Symfony/Laravel)
  • Processes to manage (web, workers, scheduler)
  • Worker count and memory limits
  • Deployment model (all-in-one or separate)

The generator will:

  1. Create supervisord.conf with proper settings
  2. Generate per-process configuration files
  3. Add Dockerfile instructions for Supervisor
  4. Configure logging to stdout/stderr for Docker

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value68/100

Highlights

  • 提供完整的 Supervisor 配置模板,涵盖 PHP-FPM、队列 worker、调度器等常见进程
  • 支持 Symfony 和 Laravel 两大主流 PHP 框架
  • 包含 Dockerfile 和 Compose 集成方案,实用性强
Trigger Precision55/100

Areas to improve

  • 缺少具体触发词描述 Reported severity: Minor

    description 字段仅概述功能,未提供如'生成 supervisor 配置'、'docker supervisor'等具体触发关键词

    Recommendation: 在 description 中添加具体触发词,如:'用于生成 Docker PHP 容器的 Supervisor 配置,支持 worker、调度器和多进程管理'

Structure and Standards78/100

Areas to improve

  • 缺少 When to Use 章节 Reported severity: Minor

    文档未明确说明适用场景和使用时机

    Recommendation: 添加 When to Use 章节,说明何时需要使用 Supervisor 管理多进程

  • 缺少用户自定义参数说明 Reported severity: Minor

    未说明用户如何自定义 worker 数量、内存限制等参数

    Recommendation: 在 Usage 部分添加参数说明表格,指导用户根据需求调整配置

Execution Reliability75/100

Highlights

  • 配置参数合理,包含自动重启、重试机制、优雅关闭等可靠性设置
  • 日志输出到 stdout/stderr,适配 Docker 日志收集
  • 提供进程组管理方案,便于批量操作
Evidence Verifiability (mean of the first four)69/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Delete files

    Confirm the absolute path and scope and keep a recoverable backup. Do not run example commands against important directories.

    Mentioned in main document · lines 206
  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 206

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.