Stop paying for nginx containers to serve static files. Here's the complete S3 + CloudFront setup with automated CI/CD — costs under $2/month.
Your React app is a collection of static files after npm run build. HTML. JavaScript. CSS. Images.
Serving static files from a Docker container on ECS is paying a chef to microwave leftovers. S3 + CloudFront costs less than a coffee per month, serves files from 400+ global edge locations, and scales to millions of requests automatically.
Here's the complete setup — S3 bucket, CloudFront distribution, CodePipeline CI/CD — so every push to main automatically builds and deploys your Vite app in under 3 minutes.
Why Not a Container?
ECS + nginx container:
EC2 instance : ~$15/month
ALB (for HTTPS) : ~$16/month
Total : ~$31/month
Regions served : 1
S3 + CloudFront:
S3 storage : ~$0.12/month
CloudFront : ~$0.88/month
Total : ~$1/month
Regions served : 400+ edge locations worldwide
The only case for containerising React: you're using Next.js with server-side…