Rule
0 installs · 0 said it worked
Production Docker rules for secure, reproducible container images
Cursor rules that make the assistant an expert Docker practitioner, guiding pinned versions, multi-stage builds, non-root users, safe secrets handling, and proper .dockerignore, volume, networking, and logging practices.
People use this for
- docker production dockerfile rules
- pinned docker image versions
- secure docker container best practices
- how to write multi-stage dockerfile
- non-root docker container setup
- Name
production-docker-rules-for-secure-reproducible-container-images- Works with
- Cursor
- License
- CC0(as observed at the source)
- Version
- v1 · updated Nov 29, 2026
Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.
Are you the author?Claim this profileRequest removal
Use this rule
$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/production-docker-rules-for-secure-reproducible-container-images-ruuj/export/mdc" -o .cursor/rules/production-docker-rules-for-secure-reproducible-container-images.mdcThen open a new session; Cursor picks it up from .cursor/rules/.
Manual install
Save production-docker-rules-for-secure-reproducible-container-images.mdc as .cursor/rules/production-docker-rules-for-secure-reproducible-container-images.mdc for this project or ~/.cursor/rules/production-docker-rules-for-secure-reproducible-container-images.mdc for every project, then start a new session.
Rule
description: "Docker production rules. Pinned versions, multi-stage builds, non-root user, minimal attack surface." globs: Dockerfile, Dockerfile., docker-compose.yml, docker-compose*.yaml, .dockerignore alwaysApply: false
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
No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.
Tried it
Reports from people who added this rule to their editor. They roll up into the badges above.
No one has filed a report yet. Try the prompt and be the first.
Related rules
- Security guardrails that keep an AI email assistant from being hijacked by malicious messages
A full system prompt giving an AI assistant that reads or manages email a security mindset: treat email as untrusted data, require approval for outward actions, avoid leaking private data, and report phishing and injection attempts calmly.
Productivity · @thanos0000
- Context7 agent that answers library questions from up-to-date docs
Agent instructions that force lookup of current library documentation via Context7 before answering framework or package questions, and check workspace versions for upgrades.
Coding · @joembolinas
- Forensic PHP codebase security, performance and quality audit
A long checklist-driven prompt that has the model act as a senior PHP reviewer and audit a codebase for type safety, security holes, database and performance issues, code quality, architecture, dependencies, and testing gaps, then report findings by severity with a final scored summary.
Coding · @ersinkoc
- Master prompt for building a district campaign field operations platform
A long master development prompt asking an AI to build a full-stack government district campaign management, field data collection, verification, and payment platform.
Coding · @maarifkhatri91
- Build a Keep a Changelog release section from Conventional Commits
Turns a git log in Conventional Commits format into a grouped Keep a Changelog release section with breaking-change notes, flagged commits and a suggested SemVer version.
Coding · @f
License: CC0v1 · published Nov 29, 2026
Comments
No comments yet. If you tried this prompt, say how it went.