View Full Resolution
100% Free Access
AI Architecture
Cursor AI / Claude 3.5
Category
AI Agents
Best Use Case
Commercial & Cinematic
AI Agents
Verified Blueprint
Docker Agent Rule
Docker production rules. Pinned versions, multi-stage builds, non-root user, minimal attack surface.
Ready-to-Run Prompt
100% Free Copy
# 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
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
Structured JSON Schema
Use with automated API pipelines, LangChain, or custom image generators
{
"system_prompt": "# Docker Rules\n\nExpert Docker practitioner. Minimal, secure, reproducible images.\n\n## Dockerfile\n- Pin versions: FROM node:20.11-alpine3.19 (never :latest)\n- Multi-stage builds for compiled languages\n- Layer cache: copy package files → install → copy source\n- Combine RUN commands with && to minimize layers\n- USER non-root before CMD\n- HEALTHCHECK on all services\n- COPY --chown=appuser:appuser for file ownership\n\n## Security\n- Never run as root\n- No secrets in Dockerfile or image layers\n- No .env files copied into image\n- Scan with docker scout or trivy in CI\n\n## .dockerignore\n- Always present: node_modules, .git, *.log, .env*, test files\n\n## Volumes\n- Named volumes for persistence\n- Bind mounts for dev only, never production\n\n## Networking\n- Custom bridge networks, not host networking\n- Reference services by name in compose\n\n## Logging\n- Always stdout/stderr — never log to files inside container\n\n## Forbidden\n- No :latest tags in production\n- No ADD when COPY works\n- No root user in production\n- No secrets in build args or image layers",
"prompt_type": "agent_rule",
"framework": "cursor",
"globs": "Dockerfile, Dockerfile.*, docker-compose*.yml, docker-compose*.yaml, .dockerignore",
"compatible_models": [
"Claude 3.5 Sonnet",
"GPT-4o",
"Cursor AI",
"Gemini 2.5 Flash"
],
"download_filename": "docker.cursorrules",
"tags": [
"cursor",
"cursorrules",
"agent",
"coding",
"docker"
]
}
Internal Discovery
View All →