Simple containerized service that implements FizzBuzz.
GET / - Health check, returns status
POST /fizzbuzz - Send a number, get fizzbuzz result back
Example:
curl -X POST http://localhost:8080/fizzbuzz \
-H "Content-Type: application/json" \
-d '{"value": 15}'
# returns: {"result": "fizzbuzz"}With Docker:
cd app
make build
make runWithout Docker (if you have Python 3.11+):
cd app
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python -m src.mainThen test: curl http://localhost:8080/
The infra/ directory has skeleton Terraform code for deploying to AWS ECS. It's not fully wired up but shows the general approach - VPC, ECS cluster, container registry, etc.
Flask - lightweight, easy to understand, perfect for simple APIs
Docker multi-stage build - keeps the final image small, separates build dependencies from runtime
ECS Fargate - don't have to manage servers, just containers. scales automatically
Terraform - standard IaC tool, easy to understand and widely used
The infrastructure code is intentionally skeleton-level - just showing the main components and how they'd fit together.