A full-stack Flask Task Manager web application containerized with Docker, deployed on Amazon EC2, and integrated with an auto-creating database using SQLAlchemy.
- Flask web app with user authentication & task management
- MySQL / MariaDB backend
- Dockerized for easy deployment
- Auto-database creation on startup
- Nginx reverse proxy configuration
- Compatible with AWS EC2 (Amazon Linux)
- Go to [AWS EC2 Console]
- Launch an instance with:
- Amazon Linux
- t2.micro (Free Tier)
- Port 22 (SSH), 80 (HTTP), 443 (HTTPS) open in Security Group
- Connect via SSH:
ssh -i your-key.pem ec2-user@your-ec2-public-ip
sudo yum update -y
sudo yum install -y git dockerInstall Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose versionEnable Docker service:
sudo systemctl start docker
sudo systemctl enable dockergit clone https://github.com/ChetanMuli/Task-manager-Docker-Python-MySQL.git
cd Task-manager-Docker-Python-MySQLCopy .env.example to .env if required:
cd app
cp .env.example .envAdjust DB credentials or secret keys as needed.
Go back to the main folder where docker-compose.yml exists:
cd ..
docker-compose up -d --buildThis will:
- Build all Docker images
- Start containers (Flask app, database, Nginx)
- Automatically create database tables
Check running containers:
docker psView logs:
docker logs <container_name>Visit in browser:
http://<EC2-Public-IP>
You should see your Task Manager web app
Stop containers:
docker-compose downRebuild (after code changes):
docker-compose up -d --buildCheck database:
docker exec -it <db-container-name or ID> bash
mysql -u <taskuser> -pIt happens automatically when the container runs.
This project is open-source and free to use for learning and deployment.