An open API service indexing awesome lists of open source software.

https://github.com/sai-123-code/age-calculator-flask-docker_ecs

A simple web-based age calculator built with Flask, deployed using Docker and AWS ECS
https://github.com/sai-123-code/age-calculator-flask-docker_ecs

docker-image ecs-fargate flask-api mlops python

Last synced: about 2 months ago
JSON representation

A simple web-based age calculator built with Flask, deployed using Docker and AWS ECS

Awesome Lists containing this project

README

          

# Age-calculator-flask-docker-ECS
This repository contains a simple Flask web application that calculates the age based on a user's date of birth, deployed using Docker and AWS ECS with Fargate. The goal of this project is to understand how Docker works, how to create Docker images, how to containerize a Python Flask application, and how to deploy it on AWS.

## Project Overview
The application is an age calculator that:
Takes a user's name and date of birth as input.
Calculates the age in years and months based on the current date (July 08, 2025, 03:42 PM IST).
Displays the result on the same page with a styled interface using CSS.

## Technologies Used
- **Python 3.13**: For the Flask backend.
- **Flask**: A micro web framework for building the application.
- **HTML/CSS**: For the frontend interface.
- **Docker**: For containerizing the application.
- **AWS IAM**: For authenticating and managing access to AWS services.
- **AWS ECR**: For storing and managing Docker images.
- **AWS ECS with Fargate**: For deploying and running the containerized application.
- **AWS Security Groups**: For controlling network access to the ECS service.

## Build the Docker Image
docker build -t calculate_age .
## Run the Container
docker run -p 8080:5000 calculate_age
## For Pushing Docker image to AWS ECR
Refer to this offical AWS blog - https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-ecr-image.html

## Screenshots of Docker image created
Screenshot 2025-07-08 142403

## Screenshots of Webpage running in docker container
Screenshot 2025-07-08 142036

## Screenshot of pushing Docker image to ECR using Amazon CLI
Screenshot 2025-07-09 155849

## Screenshot of creating ECS Cluster and related task definition with Fargate
Screenshot 2025-07-09 175456

## Screenshot of final webapp deployed in same public ip address
image