How roxsross/workshop-ecs works
Project type and purpose
• This is a containerized, single-service web application (“Voting APP”) built with Python (Flask), intended to be deployed locally via Docker Compose and in AWS using ECS.
• The README makes it clear the goals are:
• Teach local Docker workflows (compose.yml)
• Teach ECS deployment (docs/ecs.md)
File structure
• Top-level files:
• app.py – Flask application entry point
• init_db.py – script to bootstrap or migrate the database
• Dockerfile – builds the Flask app image
• compose.yml – defines local containers (app + database)
• docs/local.md, docs/ecs.md – step-by-step guides for local and ECS deployment
• static/, templates/ – front-end assets and HTML
• No separate “backend” vs. “frontend” repos: the Flask app serves both.
• No explicit Terraform or Kubernetes manifests here (despite badges), but focus is Docker/ECS.
README insights
• The app uses AWS ECS (Elastic Container Service) for production
• Local development via docker-compose
• Implied infrastructure: container registry, ECS cluster, Task Definitions, load balancer, database (likely RDS or a managed DB)
Main components
a. Client (Web browser)
b. Local Dev Environment (optional view):
• Docker Compose network
• Voting-app container (Flask + static/templates)
• Database container (e.g., PostgreSQL or SQLite)
c. AWS Production Environment:
• AWS Route 53/DNS → Application Load Balancer
• ECS Cluster (Fargate or EC2)
• Task Definition running Voting-app container
• RDS (or other managed database)
• ECR (container registry)
d. External Services & Infrastructure-as-Code (optional):
• AWS CLI/CloudFormation/Terraform for automation
Relationships and interactions
• User → ALB → ECS Task (Flask) → RDS
• In local mode: User → docker-compose Flask container → docker-compose DB
• CI/CD (if added later) pushes to ECR, then triggers ECS service update
Architectural patterns & design principles
• Container-first, immutable infrastructure
• Monolithic web service (Flask) + backing datastore
• Two deployment targets (local vs. cloud) share the same Dockerfile
• Separation of concerns: application code (app.py & templates) vs. infra definitions (compose.yml, docs)
Technologies to call out
• Python/Flask for web service
• Docker & Docker Compose for local containers
• AWS ECS (with ALB) for production orchestration
• RDS or managed DB for persistence
• (Optional) Terraform/CloudFormation for infra provisioning