The minimum stack
- IaC: Terraform, Pulumi, or OpenTofu. Pick one, version every change.
- CI/CD: GitLab CI or GitHub Actions, with required checks before merge.
- Container registry: hosted or self-hosted, with image scanning.
- Runtime: Kubernetes if you have ops capacity, ECS/Fly/Render otherwise.
- Observability: logs, metrics, traces — three tools or one combined platform.
Pipeline anatomy
push -> install -> lint -> test -> build image -> migrate -> deploy -> smoke testBlock deploy on test or migration failure. Make rollback a one-click action.
Environments
- dev: cheap, ephemeral, every PR gets a preview if practical.
- stage: production-like, used for UAT and load tests.
- prod: the only one customers see; treat it accordingly.
Secrets
A vault — never .env in git, never CI logs that print env vars. Rotate annually and on any departure.
Deploys
Rolling deploys for stateless services, blue/green for risky changes, canary releases when traffic is meaningful. Always have a documented rollback step.
What "done" looks like
A new engineer can push a commit and see it land in production within 30 minutes, with logs, metrics, and a working rollback button. Anything less is technical debt.