Awesome-claude-code check-docker-healthcheck

Checks Docker health check configuration for PHP services. Verifies PHP-FPM, Nginx, and dependent service health checks.

install
source · Clone the upstream repo
git clone https://github.com/dykyi-roman/awesome-claude-code
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/dykyi-roman/awesome-claude-code "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/check-docker-healthcheck" ~/.claude/skills/dykyi-roman-awesome-claude-code-check-docker-healthcheck && rm -rf "$T"
manifest: skills/check-docker-healthcheck/SKILL.md
source content

Docker Health Check Configuration Checker

Analyze Docker health check configuration for PHP stacks and dependent services.

Health Check Patterns by Service

1. PHP-FPM

# Using php-fpm-healthcheck script (recommended)
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=3 \
    CMD php-fpm-healthcheck || exit 1

# Using cgi-fcgi (requires libfcgi)
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=3 \
    CMD cgi-fcgi -bind -connect 127.0.0.1:9000 /ping || exit 1
; Required PHP-FPM pool config
ping.path = /ping
ping.response = pong
pm.status_path = /status

2. Nginx

HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
    CMD curl -f http://localhost/health || exit 1

# Or wget for minimal images
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
    CMD wget --spider --quiet http://localhost/health || exit 1

3. MySQL

services:
  mysql:
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s

4. PostgreSQL

services:
  postgres:
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s

5. Redis

services:
  redis:
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 5s

6. RabbitMQ

services:
  rabbitmq:
    healthcheck:
      test: ["CMD-SHELL", "rabbitmq-diagnostics check_running && rabbitmq-diagnostics check_local_alarms"]
      interval: 15s
      timeout: 10s
      retries: 5
      start_period: 30s

Recommended Parameters

Serviceintervaltimeoutstart_periodretries
PHP-FPM10s3s10s3
Nginx10s3s5s3
MySQL10s5s30s5
PostgreSQL10s5s30s5
Redis10s3s5s3
RabbitMQ15s10s30s5

Improper Health Check Detection

# BAD: Too frequent (overhead)
HEALTHCHECK --interval=1s --timeout=1s --retries=1 CMD curl localhost

# BAD: No start_period (fails during init)
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD pg_isready

# BAD: Checking external dependency
HEALTHCHECK CMD curl -f https://api.external.com/health

# BAD: Too slow detection (interval*retries > 5min)
HEALTHCHECK --interval=60s --timeout=30s --retries=10 CMD curl localhost

Grep Patterns

Grep: "HEALTHCHECK" --glob "**/Dockerfile*"
Grep: "healthcheck:" --glob "**/docker-compose*.yml"
Grep: "depends_on:" --glob "**/docker-compose*.yml"
Grep: "ping\\.path|pm\\.status_path" --glob "**/*.conf"

Severity Classification

IssueSeverityImpact
No health check for any serviceCriticalNo failure detection
PHP-FPM without health checkCriticalDead workers undetected
Database without health checkMajorApp starts before DB ready
No start_period for databasesMajorFalse unhealthy during init
Checking external dependencyMajorExternal outage cascades
depends_on without conditionMajorStartup race condition
Interval too low (< 5s)MinorUnnecessary overhead
Interval too high (> 60s)MinorSlow failure detection
timeout >= intervalMinorOverlapping checks

Output Format

### Health Check Issue: [Description]

**Severity:** Critical/Major/Minor
**Service:** [service name]
**File:** `docker-compose.yml:line` or `Dockerfile:line`

**Issue:**
[Description of missing or misconfigured health check]

**Recommended:**
```yaml
healthcheck:
  test: ["CMD-SHELL", "..."]
  interval: 10s
  timeout: 3s
  start_period: 10s
  retries: 3

Parameters:

ParamCurrentRecommendedReason
intervalN/A10sStandard frequency
timeoutN/A3sFast failure detection
start_periodN/A10sAllow initialization
retriesN/A3Prevent flapping