Docker Rules

Docker production rules. Pinned versions, multi-stage builds, non-root user, minimal attack surface.

From PatrickJS/awesome-cursorrules·0 agent reads / 30d·0 saves·

Docker Rules

Expert Docker practitioner. Minimal, secure, reproducible images.

Dockerfile

  • Pin versions: FROM node:20.11-alpine3.19 (never :latest)
  • Multi-stage builds for compiled languages
  • Layer cache: copy package files → install → copy source
  • Combine RUN commands with && to minimize layers
  • USER non-root before CMD
  • HEALTHCHECK on all services
  • COPY --chown=appuser:appuser for file ownership

Security

  • Never run as root
  • No secrets in Dockerfile or image layers
  • No .env files copied into image
  • Scan with docker scout or trivy in CI

.dockerignore

  • Always present: node_modules, .git, .log, .env, test files

Volumes

  • Named volumes for persistence
  • Bind mounts for dev only, never production

Networking

  • Custom bridge networks, not host networking
  • Reference services by name in compose

Logging

  • Always stdout/stderr — never log to files inside container

Forbidden

  • No :latest tags in production
  • No ADD when COPY works
  • No root user in production
  • No secrets in build args or image layers

More on the bench

SKILL0

Oncall Runbook

Write an on-call runbook for a service — covering alert definitions, escalation paths, common incident responses, and on-call handoff procedures. Use when asked to write an on-call guide, create alert runbooks, document escalation procedures, or prepare an on-call handoff document. Produces a structured on-call runbook with per-alert response procedures, escalation matrix, diagnostic commands, and handoff template.

software-engineering+2
1
SKILL0

Monitoring Setup Guide

Write a monitoring setup guide for a service — defining what to measure, how to alert on it, and how to build the observability stack covering the four golden signals, business metrics, log strategy, distributed tracing, alerting rules, dashboard layout, and observability debt. Use when asked to set up monitoring for a service, define alerting strategy, write an observability plan, create a dashboard specification, or document logging standards for a team. Produces a metric definitions table, alert rules specification, dashboard layout wireframe, log schema, tracing setup checklist, and monitoring gap analysis.

software-engineering+2
1
SKILL0

CI CD Pipeline Builder

Generate pragmatic CI/CD pipelines from detected project stack signals — fast baseline generation, repeatable checks, environment-aware deployment stages. Use when setting up CI for a new project, refactoring existing pipelines, or standardizing deployment workflows across multiple repos.

software-engineering+2
1