Best for
- Production deployment (use aws-infrastructure skill)
- Codespaces setup (use devcontainer skill)
event4u-app/agent-config/src/skills/docker/SKILL.md
Use when working with Docker — Dockerfile edits, docker-compose services, containers, or the dual-container (fast + Xdebug) setup — even when the user just says 'my container won't start'.
Decision brief
Use when working with Docker — Dockerfile edits, docker-compose services, containers, or the dual-container (fast + Xdebug) setup — even when the user just says 'my container won't start'.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/docker"Inspect the Agent Skill "docker" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/docker/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Gather context — read project Docker docs in agents/ or Docs/, check Makefile/Taskfile.yml for targets, read docker-compose.yml/compose.yaml for service layout. 2. Identify scope — determine which service(s) are affected (PHP, NGINX, worker, scheduler, database). 3. Inspect c…
Use this skill when working with Docker configuration, container setup, Dockerfile changes, or docker-compose modifications.
Multi-stage build with these targets:
Multi-stage build with these targets:
Some projects run two PHP-FPM containers simultaneously (fast + Xdebug):
Permission review
The documentation asks the agent to create, modify, or delete local files.
**Make the change** — edit the relevant file (Dockerfile, compose file, NGINX config, Makefile target). Follow the conventions in the reference sections below.The documentation asks the agent to run terminal commands or scripts.
make start # Start all containersThe documentation asks the agent to run terminal commands or scripts.
make stop # Stop all containersThe documentation includes network, browsing, or remote request actions.
CMD curl -f http://localhost:8080/health || exit 1Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 7 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill when working with Docker configuration, container setup, Dockerfile changes, or docker-compose modifications.
Do NOT use when:
aws-infrastructure skill)devcontainer skill)agents/ or Docs/, check Makefile/Taskfile.yml for targets, read docker-compose.yml/compose.yaml for service layout.docker compose ps to see running containers and their health status.docker compose build <service> (add --no-cache if Dockerfile base layers changed).docker compose up -d, check docker compose ps for healthy status, run a smoke test (e.g., make test-quick or curl localhost)..docker/Dockerfile)Multi-stage build with these targets:
| Stage | Purpose |
|---|---|
base | Alpine + PHP-FPM + system packages + extensions |
dev | Development: Xdebug, dev tools, Composer dev deps |
pro | Production: optimized, no dev deps, New Relic agent |
Key build args:
PHP_VERSION — extracted from Dockerfile, used by CICOMPOSER_AUTH — private registry access (passed as secret)CACHEBUST — weekly cache invalidation (date +%Y-%U)COMPOSER_NO_DEV — 1 for production, 0 for devSome projects run two PHP-FPM containers simultaneously (fast + Xdebug):
| Container | Purpose | PHP-FPM mode |
|---|---|---|
{project}-php | Fast execution, no debugger | pm = dynamic |
{project}-php-xdebug | Xdebug enabled, debugging | pm = ondemand |
NGINX routes requests based on HTTP headers:
X-Xdebug-Enable: 1 or X-Debug-Session: PHPSTORM → Xdebug containerRead docker-compose.yml / compose.yaml to discover the actual service names. Common patterns:
| Service type | Description |
|---|---|
| PHP-FPM | Main application server |
| PHP-FPM + Xdebug | Debugging container |
| NGINX | Reverse proxy |
| Queue worker | Background job processing (e.g., Horizon) |
| Scheduler | Cron/task scheduler |
| Database | MariaDB / MySQL / PostgreSQL |
| Cache | Redis / Memcached |
docker compose exec -T <service> ... for non-interactive (scripts, CI).make console for interactive shell access.make console-xdebug for Xdebug container access.target: pro — no dev dependencies.Extensions are installed via mlocati/php-extension-installer:
base stage so they're available in all targets..env is NOT baked into the Docker image..env is fetched from AWS Secrets Manager at deploy time..env is mounted via docker-compose volumes.Always check the Makefile for available targets before using raw docker commands:
make start # Start all containers
make stop # Stop all containers
make console # Enter PHP container (bash)
make console-xdebug # Enter Xdebug PHP container
make composer-install # Run composer install in container
make migrate # Run migrations
make migrate-and-seed # Run migrations + seed
make test # Run all tests (parallel)
When the development environment is out of sync (missing containers, wrong state):
docker compose ps to see which services are running.make start or docker compose up -d.docker compose build --no-cache <service> after Dockerfile changes.make migrate-and-seed after fresh container start.| Symptom | Cause | Fix |
|---|---|---|
| "Connection refused" | Container not running | make start |
| "Table not found" | Migrations not run | make migrate-and-seed |
| "Class not found" | Composer not installed | make composer-install |
| Old PHP version | Image not rebuilt | docker compose build <php-service> |
| Extension missing | Dockerfile changed | Rebuild with --no-cache |
When running multiple projects simultaneously:
traefik skill) for routing by domain instead of port.docker-compose.shared.yml.When creating or reviewing Dockerfiles:
USER directive before CMD.ENV or COPY secrets. Use --mount=type=secret (BuildKit) or runtime secrets.RUN layer.--read-only flag where possible, mount writable dirs explicitly.latest tag — pin base image versions (node:18.19-alpine, not node:latest).docker scout quickview or Trivy for vulnerability scanning.# Security pattern
RUN addgroup -g 1001 -S appgroup && \
adduser -S appuser -u 1001 -G appgroup
COPY --chown=appuser:appgroup . .
USER 1001
Always add health checks to long-running services:
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
In docker-compose, use condition: service_healthy for dependency ordering:
services:
app:
depends_on:
db:
condition: service_healthy
| Technique | Impact | When |
|---|---|---|
| Multi-stage builds | High | Always — separate build from runtime |
| Alpine base images | High | When compatibility allows |
| Distroless images | High | Production, no shell needed |
.dockerignore | Medium | Always — exclude node_modules, .git, tests, docs |
Combine RUN layers | Medium | When installing packages + cleaning cache |
| Copy only artifacts | Medium | COPY --from=build only what's needed |
Use BuildKit cache mounts for package managers:
# Composer (PHP)
RUN --mount=type=cache,target=/root/.composer/cache \
composer install --no-dev --optimize-autoloader
# npm (Node.js)
RUN --mount=type=cache,target=/root/.npm \
npm ci --only=production
Layer ordering for cache efficiency:
composer.json, package.json) — changes sometimesRUN install — cached if dependency files unchangedCOPY . .) — changes often, last layer| Symptom | Root cause | Fix |
|---|---|---|
| Every build reinstalls all dependencies (builds are slow) | COPY . . runs before the dependency install, so any source edit busts the dependency layer's cache | Copy only the manifest + lockfile (composer.json+composer.lock / package.json+lock), install deps, THEN COPY . . |
| Image is much larger / slower to push than expected | No .dockerignore, so .git, vendor/, node_modules/, and local env files enter the build context and image | Add a .dockerignore excluding VCS, installed deps, build output, and secrets |
vendor/ or node_modules/ is empty inside the container even though install ran | A bind-mount of the project directory shadows the image's installed-deps directory | Put a named/anonymous volume over the deps dir, or don't bind-mount over it |
Files the container writes are owned by root on the host | The container process runs as UID 0; bind-mounted writes inherit that owner | Run as a non-root USER whose UID matches the host user, or chown on entry |
| Container exits immediately with code 0 | The CMD process daemonizes/backgrounds, so PID 1 has nothing to keep alive | Run the long-lived process in the foreground as PID 1 (no &, no daemonize flag) |
docker compose down -v destroys volumes including the database — use down without -v unless you mean it.docker compose exec -T (no TTY) when running in scripts or CI.pro stage.platform without verifying AWS runner architecture.traefik — local reverse proxy with real domains and HTTPSdevcontainer — DevContainer and Codespaces setupphp-debugging — Xdebug dual-container architecturedocker-commands.md — all PHP commands run inside DockerAlternatives
coreyhaines31/marketingskills
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
event4u-app/agent-config
Grounded design brief from the adopted corpus — style, WCAG-checked color tokens, typography, layout pattern, anti-patterns. Use on ui-design-brief or any which-style/palette/font/chart decision.
event4u-app/agent-config
Use BEFORE writing or editing any non-trivial UI — inventories components, design tokens, shadcn primitives, and reusable patterns into state.ui_audit. Hard gate for the ui directive set.
event4u-app/agent-config
Use BEFORE writing/changing tests, adding mocks, or test-only methods on production classes — vs mocking-the-mock, production pollution, partial mocks, and overfit/tautological assertions