17 lines
797 B
Plaintext
17 lines
797 B
Plaintext
---
|
|
description: Docker and DevOps — images, compose, and CI hygiene
|
|
globs: **/{Dockerfile,docker-compose*.{yml,yaml},.github/workflows/*.{yml,yaml}}
|
|
alwaysApply: false
|
|
---
|
|
|
|
# Docker & DevOps
|
|
|
|
- Use multi-stage builds. Final image should not contain build tools or source maps unless needed.
|
|
- Run containers as non-root users when possible.
|
|
- Pin base image versions (`node:22-alpine`, not `node:latest`).
|
|
- Never bake secrets into images. Inject via env vars or secret managers at runtime.
|
|
- `.dockerignore` should exclude `node_modules`, `.git`, tests, and local env files.
|
|
- Health checks: define `HEALTHCHECK` or orchestrator probes for services.
|
|
- CI: cache dependencies, run lint + test on every PR, fail fast on first error.
|
|
- One concern per workflow job. Parallelize independent jobs.
|