The same store and API, three ways to run them: Docker Compose on a laptop, ECS on AWS with Terraform, and Kubernetes on kind. Each topic links to the config that does it.
What's in it
Four parts of the infrastructure worth a closer look, with links to the files.
Docker
The store image is multi-stage: one stage builds, a slim runtime stage copies only the standalone output. Contentful keys reach the build as BuildKit secrets, so they never land in an image layer. One Compose file runs the store, API, Postgres, and GrowthBook together.
The API runs on ECS Express Mode: one resource gives a Fargate service, an HTTPS load balancer, auto scaling, and logs. Permanent pieces (ECR, the deploy role) live apart from the per-session service, which is destroyed after each work session to keep costs near zero.
GitHub Actions deploys with short-lived AWS credentials from OIDC, so no AWS keys are stored in GitHub. The API token and the Anthropic key live in SSM Parameter Store, created once from the CLI so their values never enter Terraform state. ECS injects them at start.
The whole stack on a local cluster: Postgres, two API replicas with health probes, and two store replicas behind Traefik. Rolling updates keep old pods serving until new ones are ready. Secrets come from local env files and are never committed.
The plan started on App Runner, which stopped taking new customers in April 2026. ECS Express Mode is the replacement. Lesson: check availability and deprecation notices before picking a service, not after.
Hard: a manual fix survived kubectl apply
A command patched in by hand wasn't in the last-applied record, so the three-way merge kept it through apply. A rollout undo cleared it. GitOps tools like Argo CD or Flux make Git the only way in, which prevents this.
Differently: keep state out of the pods
The Sensei daily limit is counted in memory, so with two API replicas each pod counts on its own. It worked on one container and broke quietly on two. A shared store (Redis or Postgres) from the start would have scaled with no change.
Differently: a real secrets store on the cluster
Kubernetes Secrets in kind are base64, not encrypted at rest. Fine for local drills. On a real cluster, an external secrets store would pull from SSM, the same place ECS already reads.