Skip to content

0011. Hosting: containers (Docker Compose locally → AWS ECS Fargate), CDN for game assets

  • Status: Accepted; amended by ADR 0028 (production starts on a single VPS; AWS later)
  • Date: 2026-11-26
  • Phase: 3 (local Compose), 7 (production)

The whole stack must run locally with one command and deploy to the cloud by configuration. Full comparison and cost estimates in docs/hosting.md.

  • Local: docker compose up runs Postgres, S3-compatible storage, the API/web server, the job worker and the play-origin static server; framework/game dev uses pnpm dev (Vite) without Docker.
  • Cloud (Phase 7): the same images on AWS ECS Fargate behind an ALB; RDS PostgreSQL; S3 for blobs and published game builds; CloudFront in front of the web app and a separate distribution for the play origin; Secrets Manager for secrets; infrastructure as code with AWS CDK (TypeScript).
  • Environment differences live in config only (DATABASE_URL, S3_ENDPOINT, PLAY_ORIGIN, …).
  • Re-check CDN egress pricing at Phase 7 (CloudFront flat-rate plans vs. Cloudflare R2 for published game assets).
  • AWS serverless (Lambda + API Gateway + Aurora Serverless): cheapest at tiny scale, but Lambda fits poorly with long-running headless Chromium runs, sandboxed builds and WebSocket game servers, and local parity is weaker.
  • BaaS (Supabase + Cloudflare/Vercel): fastest to start and cheapest bandwidth, but splits logic across vendors and makes the data model and auth vendor-shaped.

A small fixed monthly floor in the cloud (~$50–70 at idle with Fargate + RDS). Mitigation: for a private staging environment, the same Compose file can run on a single small VM.