This project is a containerized Streamlit application deployed on AWS using ECS Fargate with an Application Load Balancer (ALB). This README walks through the full setup: local testing, Docker image creation, ECR push, and ECS service deployment.
.
├── app/
│ ├── main.py
│ ├── logger.py
│ ├── model_loader.py
│ ├── predictor.py
│ └── models/
├── requirements.txt
├── Dockerfile
pytest test/docker build -t cloud-classifier .
docker run -p 8501:8501 cloud-classifierVisit: http://localhost:8501
In AWS Console > ECR > Create private repo (e.g. cloud-classifier).
docker build -t cloud-classifier .
docker tag cloud-classifier:latest <account-id>.dkr.ecr.us-east-2.amazonaws.com/cloud-classifier:latest
docker push <account-id>.dkr.ecr.us-east-2.amazonaws.com/cloud-classifier:latest- Launch type: Fargate
- Task role:
TaskAppRole - Execution role:
TaskExecutionRole - Container name: cloud-classifier
- Image: paste full ECR image URI
- Port mapping:
8501
- Use or create ECS Cluster (e.g.
cloud-hw3)
- Launch type: Fargate
- Number of tasks:
1 - Load balancing: Enabled
- Type: Application Load Balancer
- Listener: Port
80, ProtocolHTTP - Target group:
- Name:
cloud-classifier-tg - Protocol: HTTP
- Health check path:
/or your Streamlit endpoint - Port:
8501
- Name:
- Choose public subnets (with internet access)
- Assign public IP
- Choose a Security Group that allows:
- Inbound Rule: HTTP port
80from0.0.0.0/0 - All traffic from self SG (for internal)
- Inbound Rule: HTTP port
Once the deployment shows 1/1 Tasks Running and ALB is healthy:
- Go to EC2 > Load Balancers
- Copy the DNS name of the ALB
- Open:
http://<alb-dns-name>
- ALB port 80 is external. Inside the container, the app runs on port 8501.
- Health checks should use a valid path that returns HTTP 200.
- If you modify image, push new tag and update ECS task definition.