/acc:docker-compose-knowledgefrom acc
Configures Docker Compose for PHP stacks with service patterns, health checks, networking, and environment management.
Ships in acc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Service configuration patterns and best practices for Docker Compose in PHP applications.
┌─────────────────────────────────────────────────────────────────────────────┐
│ DOCKER COMPOSE PHP STACK │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ FRONTEND NETWORK │ │
│ │ │ │
│ │ :80/:443 :8025 │ │
│ │ ┌────────┐ ┌────────┐ │ │
│ │ │ Nginx │ │Mailhog │ │ │
│ │ └───┬────┘ └────────┘ │ │
│ │ │ fastcgi:9000 │ │
│ └───────┼────────────────────────────────────────────────────┘ │
│ │ │
│ ┌───────┼────────────────────────────────────────────────────┐ │
│ │ ▼ BACKEND NETWORK │ │
│ │ ┌────────┐ │ │
│ │ │PHP-FPM │──┐ │ │
│ │ └────────┘ │ │ │
│ │ │ │ │
│ │ ┌────────┐ │ ┌────────┐ ┌──────────┐ ┌────────┐ │ │
│ │ │Worker │──┤ │ Redis │ │PostgreSQL│ │RabbitMQ│ │ │
│ │ └────────┘ │ │ :6379 │ │ :5432 │ │ :5672 │ │ │
│ │ │ └────────┘ └──────────┘ └────────┘ │ │
│ │ ┌────────┐ │ │ │
│ │ │ Cron │──┘ ┌──────────────┐ ┌────────┐ │ │
│ │ └────────┘ │Elasticsearch │ │ MinIO │ │ │
│ │ │ :9200 │ │ :9000 │ │ │
│ │ └──────────────┘ └────────┘ │ │
│ └────────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ MONITORING NETWORK │ │
│ │ ┌──────────┐ ┌─────────┐ ┌────────┐ │ │
│ │ │Prometheus│ │ Grafana │ │ Jaeger │ │ │
│ │ │ :9090 │ │ :3000 │ │ :16686 │ │ │
│ │ └──────────┘ └─────────┘ └────────┘ │ │
│ └────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
# docker-compose.yml — base configuration
version: "3.9"
x-php-base: &php-base
build:
context: .
dockerfile: docker/php/Dockerfile
target: dev
volumes:
- .:/app:cached
- vendor:/app/vendor
environment:
APP_ENV: ${APP_ENV:-dev}
DATABASE_URL: postgresql://app:secret@postgres:5432/app?serverVersion=16
REDIS_URL: redis://redis:6379
MESSENGER_TRANSPORT_DSN: amqp://guest:guest@rabbitmq:5672/%2f/messages
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
services:
php:
<<: *php-base
expose:
- "9000"
networks:
- frontend
- backend
worker:
<<: *php-base
command: php bin/console messenger:consume async --time-limit=3600
restart: unless-stopped
networks:
- backend
cron:
<<: *php-base
command: crond -f -d 8
networks:
- backend
nginx:
image: nginx:1.27-alpine
ports:
- "${NGINX_PORT:-80}:80"
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./public:/app/public:ro
depends_on:
- php
networks:
- frontend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 10s
timeout: 5s
retries: 3
volumes:
vendor:
postgres-data:
redis-data:
elasticsearch-data:
rabbitmq-data:
minio-data:
networks:
frontend:
driver: bridge
backend:
driver: bridge
monitoring:
driver: bridge
postgres:
image: postgres:16-alpine
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-app} -d ${POSTGRES_DB:-app}"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
mysql:
image: mysql:8.4
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 5s
timeout: 5s
retries: 5
start_period: 20s
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 3
rabbitmq:
image: rabbitmq:3.13-management-alpine
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 10s
retries: 5
start_period: 30s
elasticsearch:
image: elasticsearch:8.15.0
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 10s
retries: 5
start_period: 30s
php:
healthcheck:
test: ["CMD-SHELL", "php-fpm-healthcheck || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
| Strategy | Syntax | Performance | Use Case |
|---|---|---|---|
| Bind mount | ./src:/app/src | Native (Linux), slow (Mac) | Development source |
| Bind + cached | ./src:/app/src:cached | Better on Mac | Dev source on macOS |
| Named volume | vendor:/app/vendor | Fast | Dependencies, data |
| tmpfs | tmpfs: /tmp | Fastest | Temporary files, cache |
| Anonymous | /app/var | Fast | Ephemeral data |
volumes:
- .:/app:cached # Source code (bind, dev only)
- vendor:/app/vendor # Composer vendor (named)
- ./docker/php/php.ini:/usr/local/etc/php/php.ini:ro # Config (bind, ro)
.env # Defaults (committed to git)
.env.local # Local overrides (gitignored)
.env.${APP_ENV} # Per-environment (committed)
.env.${APP_ENV}.local # Per-environment local (gitignored)
# .env (project root — Docker Compose reads this)
COMPOSE_PROJECT_NAME=myapp
COMPOSE_FILE=docker-compose.yml:docker-compose.override.yml
# Service versions
POSTGRES_VERSION=16
REDIS_VERSION=7
RABBITMQ_VERSION=3.13
# Ports (avoid conflicts)
NGINX_PORT=80
POSTGRES_PORT=5432
REDIS_PORT=6379
RABBITMQ_PORT=5672
RABBITMQ_MGMT_PORT=15672
# Credentials
POSTGRES_USER=app
POSTGRES_PASSWORD=secret
POSTGRES_DB=app
# docker-compose.override.yml — development overrides (auto-loaded)
services:
php:
build:
target: dev
volumes:
- .:/app:cached
environment:
XDEBUG_MODE: debug
XDEBUG_CONFIG: client_host=host.docker.internal
mailhog:
image: mailhog/mailhog:latest
ports:
- "8025:8025"
networks:
- frontend
# docker-compose.prod.yml — production overrides
services:
php:
build:
target: production
volumes: [] # No bind mounts
restart: unless-stopped
nginx:
restart: unless-stopped
Usage:
# Development (auto-loads override)
docker compose up -d
# Production
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
# Testing
docker compose -f docker-compose.yml -f docker-compose.test.yml up -d
services:
php:
# Always starts (no profile)
elasticsearch:
profiles: ["search"]
mailhog:
profiles: ["dev"]
prometheus:
profiles: ["monitoring"]
grafana:
profiles: ["monitoring"]
# Start core services only
docker compose up -d
# Start with search
docker compose --profile search up -d
# Start with monitoring
docker compose --profile monitoring up -d
# Start everything
docker compose --profile search --profile monitoring --profile dev up -d
networks:
frontend:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/24
backend:
driver: bridge
internal: true # No external access
monitoring:
driver: bridge
| Service | frontend | backend | monitoring |
|---|---|---|---|
| nginx | yes | - | - |
| php-fpm | yes | yes | - |
| worker | - | yes | - |
| postgres | - | yes | - |
| redis | - | yes | - |
| rabbitmq | - | yes | - |
| prometheus | - | - | yes |
| grafana | - | - | yes |
php:
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
php:
deploy:
resources:
limits:
cpus: "2.0"
memory: 512M
reservations:
cpus: "0.5"
memory: 256M
php:
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
For complete service configurations, see references/service-configs.md.
For networking details, see docker-networking-knowledge.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub dykyi-roman/awesome-claude-code --plugin acc283 skills in this plugin
/access-control-knowledgeAccess Control knowledge base. Provides ACL, RBAC, ABAC, ReBAC models, multi-tenancy patterns, and PHP implementations (Symfony Voters, Laravel Gates) for security audits and generation./adr-knowledgeAction-Domain-Responder pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for ADR (web-specific MVC alternative) audits./adr-templateGenerates Architecture Decision Records (ADR) for PHP projects. Creates structured decision documentation with context, decision, and consequences./analyze-ci-configAnalyzes existing CI/CD configurations. Detects issues in GitHub Actions and GitLab CI files, checks for best practices, caching efficiency, and security concerns./analyze-ci-logsAnalyzes CI/CD pipeline logs to identify failure causes. Parses error messages, detects common failure patterns, and provides fix recommendations./analyze-coupling-cohesionAnalyzes coupling and cohesion metrics in PHP codebases. Calculates Afferent/Efferent coupling (Ca/Ce), LCOM metrics, instability index, and abstractness. Identifies highly coupled modules and low cohesion classes.Other plugins' skills for the same job