A simple URL shortener web application built with Flask, containerized using Docker, and deployed to Azure App Service using Terraform for Infrastructure as Code (IaC).
This project demonstrates:
- Application development using Python (Flask)
- Containerization with Docker
- Deployment using Azure App Service for Linux
- Infrastructure provisioning with Terraform
- Docker image hosted on Docker Hub
Goal: Build a real-world cloud-native app using DevOps best practices.
| Layer | Technology |
|---|---|
| Language | Python (Flask) |
| Container | Docker |
| Cloud Platform | Microsoft Azure |
| IaC | Terraform |
| Container Registry | Docker Hub |
| Web Hosting | Azure App Service |
url-shortener/
│
├── app.py # Main Flask app
├── Dockerfile # Docker build instructions
├── requirements.txt # Python dependencies
│
├── terraform/ # Terraform IaC configs
│ ├── main.tf
│ ├── variables.tf
│ ├── outputs.tf
│ └── terraform.tfvarsYou can pull the image manually:
docker pull xamuel09/url-shortener:latestOr run it locally:
docker run -p 8080:8080 xamuel09/url-shortenerThen open http://localhost:8080
cd terraform
terraform initterraform planterraform applyOutputs will include a link like:
https://urlshortenerapp12345.azurewebsites.net
Defined in terraform.tfvars:
resource_group_name = "rg-url-shortener"
app_service_plan_name = "asp-url-shortener"
web_app_name = "urlshortenerapp12345"
docker_image = "xamuel09/url-shortener:latest"
location = "West Europe"Coming soon! (See below for how to create this visually)
This project is licensed under the MIT License.