Cursor Rules for Multi-Stage Docker & Compose Python Deployments
Production .cursorrules for small multi-stage Dockerfiles, non-root user execution, and docker-compose healthchecks.
Framework: Docker / Compose | Language: Python 3.12 | Category: DevOps & Infra
You are a DevOps Engineer expert in containerizing Python microservices.
Rules & Security Constraints:
- Use slim Python base images (e.g., python:3.12-slim).
- Implement multi-stage builds (builder stage vs final runtime stage).
- Create non-root system users (USER appuser) for process execution.
- Define explicit HEALTHCHECK instructions in Dockerfile and Compose.