docker-patterns

docker-patterns is a skill for Claude Code, Codex from pekral/cursor-rules. It costs 55 tokens per session (2,115 once invoked), scanned A, original, MIT.

A guide for creating or reviewing Docker and Docker Compose setups for Laravel applications. Docker packages an application and its services into containers, while Compose describes how those containers run together.

In plain words
What is it for?
Use it for Laravel setups involving PHP-FPM, Nginx, MySQL, Redis, queue workers, schedulers, Vite builds, or production container hardening.
Why use it?
It sets consistent practices for reproducible builds, separate application processes, health checks, image size, and secret handling. It also keeps development and production concerns separated.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is COPY --from=assets --chown=app:app /app/public/build ./public/build.

Good fit Use it for Laravel setups involving PHP-FPM, Nginx, MySQL, Redis, queue workers, schedulers, Vite builds, or production container hardening.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/pekral/cursor-rules
agentmods
npx agentmods add skills/pekral/cursor-rules/docker-patterns

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docker-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/pekral/cursor-rules/docker-patterns/github.svg)](https://agentmods.dev/skills/pekral/cursor-rules/docker-patterns)
Your own site
<a href="https://agentmods.dev/skills/pekral/cursor-rules/docker-patterns"><img src="https://agentmods.dev/badge/skills/pekral/cursor-rules/docker-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docker-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/pekral/cursor-rules/docker-patterns"><img src="https://agentmods.dev/badge/skills/pekral/cursor-rules/docker-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,115 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.02115
Opus 5.5 $0.00022 $0.00846
Sonnet 5.5 $0.00011 $0.00423
Haiku 4.5 $0.00006 $0.00212

Measured 1mo ago against content hash 7fb50234affe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

docker-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/docker-patterns/SKILL.md · 205 lines

How it starts

The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Docker Patterns

Constraints

  • Apply @rules/security/backend.md — never bake secrets into image layers, inject them at runtime; apply least privilege (non-root user, dropped capabilities, least-privileged DB user).
  • Apply @rules/laravel/laravel.mdc — respect Laravel's directory layout, artisan commands, and config caching.
  • Pin every base image to a specific tag (never :latest) for reproducible builds.
  • One process per container: PHP-FPM, queue worker, and scheduler are separate containers sharing the same image.
  • .env and secrets stay out of images and out of git.

Use when

  • Writing or reviewing a Dockerfile / docker-compose.yml for a Laravel app.
  • Setting up local dev (nginx + PHP-FPM + MySQL + Redis) or a build pipeline for a production image.
  • Reviewing image size, layer caching, healthchecks, or secret handling.

Multi-Stage Dockerfile (PHP-FPM)

Separate Composer deps, the Vite/asset build, and the lean runtime so each layer caches independently and dev tooling never ships to production.

# syntax=docker/dockerfile:1

# --- Stage: composer deps (cached unless composer.* change) ---
FROM composer:2 AS vendor
WORKDIR /app
COPY composer.json composer.lock ./
RUN composer install --no-dev --no-scripts --prefer-dist \
    --optimize-autoloader --no-interaction

# --- Stage: node/vite asset build ---
FROM node:22-alpine AS assets
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY vite.config.js ./
COPY resources ./resources
RUN npm run build              # emits public/build via laravel-vite-plugin

# --- Stage: runtime (php-fpm, non-root, opcache) ---
FROM php:8.3-fpm-alpine AS runtime
RUN apk add --no-cache fcgi \
    && docker-php-ext-install pdo_mysql opcache bcmath pcntl \
    && addgroup -g 1000 -S app && adduser -S app -u 1000 -G app
COPY docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
WORKDIR /var/www/html
COPY --chown=app:app . .
COPY --from=vendor --chown=app:app /app/vendor ./vendor
COPY --from=assets --chown=app:app /app/public/build ./public/build
USER app
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s \
    CMD php-fpm-healthcheck || exit 1
EXPOSE 9000
CMD ["php-fpm"]

Read the full file on GitHub · 205 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 205 lines · 55 tokens per session scan A 7fb50234affe

Subscribe to this mod's changes

docker-patterns is a skill published in the GitHub repository pekral/cursor-rules (11 stars, last pushed 13d ago), licensed MIT. It adds 55 tokens to every session and 2,115 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

github-actions-templates

Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.

wshobson/agents · 44 tokens

create-powergrid-plugin

Create a complete PowerGrid plugin from scratch, including PHP class, Column macro, Blade view, Alpine.js component, and registration.

Power-Components/livewire-powergrid · 31 tokens

owl-admin-app-dev

Use this skill when developing an application that installed slowlyo/owl-admin, especially backend CRUD, menus, permissions, controllers, services, routes, config/admin.php, app/Admin, helper functions, settings(), adminpages(), AdminPipeline, upload/file preview issues, route conflicts, custom login/menu examples, or…

slowlyo/owl-admin · 114 tokens

owl-admin-amis-page

A reference skill for building Owl Admin pages with amis, a system for defining admin interfaces such as forms, tables, filters, and actions through schemas.

slowlyo/owl-admin · 84 tokens

owl-admin-devtools-generator

A development guide for Owl Admin, a Laravel-based administration system, covering its code generator, API templates, relationships, and visual pages.

slowlyo/owl-admin · 82 tokens

owl-admin-frontend-assets

A development guide for the browser-side files and published assets used by Owl Admin, a Laravel-based administration system. It covers admin views, themes, layouts, React work, and asset publishing.

slowlyo/owl-admin · 80 tokens