trove-docker

A set of rules for Dockerfiles and Docker Compose files. Docker packages an application with its dependencies into containers, while Docker Compose defines how multiple containers run together.

In plain words
What is it for?
Use it when creating or editing Docker build files and Compose configurations, including dependency layers, multi-stage builds, non-root users, image versions, and production health checks.
Why use it?
It helps avoid common container problems such as oversized images, poor build caching, running as the root user, unbounded versions, and missing health checks.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/bravew/trove/trove-docker
Clone the repo
git clone --depth 1 https://github.com/bravew/trove
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 408 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00408
Opus 5 $0.00000 $0.00204
Sonnet 5 $0.00000 $0.00082
Haiku 4.5 $0.00000 $0.00041

Measured 2d ago against content hash 745a98296b54, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

trove-docker 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 2d 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.

plugins/trove-infra/rules/trove-docker.mdc · 63 lines

What it actually says

Trove · v2026.7.4

Session Init

This skill ships Trove conventions. Prefer existing project patterns over generic best practices when they conflict.

Docker Conventions

Dockerfile Best Practices

# Use specific version tags, not :latest
FROM python:3.13-slim AS base

# Set working directory early
WORKDIR /app

# Copy dependency files first (cache layer)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code last (changes most often)
COPY . .

# Run as non-root user
RUN adduser --disabled-password --gecos '' appuser
USER appuser

EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

Multi-Stage Builds

Use multi-stage builds to reduce image size:

FROM node:22-alpine AS builder
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build

FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html

AI Gotchas

  • Layer caching: Order instructions from least to most frequently changing
  • COPY vs ADD: Use COPY unless you need URL download or tar extraction
  • HEALTHCHECK: Always include for production images
  • .dockerignore: Exclude node_modules, .git, .env, test files
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. 2d ago First seen · 63 lines · 408 tokens per session scan A 745a98296b54

Subscribe to this mod's changes

trove-docker is a cursor rule published in the GitHub repository bravew/trove (10 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 408 tokens. 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.