I started this project by provisioning an Azure Virtual Machine (VM) using Terraform, along with the necessary networking components such as Virtual Network (VNet), Subnet, and Network Security Group (NSG). Manually installing and configuring software on the VM would have been time-consuming and error-prone, so I used Ansible Playbooks to automate the installation of Docker and Nginx.
Instead of running Nginx directly on the VM, I leveraged Docker to containerise the application. This approach makes the deployment more portable and scalable, reducing dependencies on the underlying VM and simplifying updates. Using Docker Hub, I pulled an Nginx image, tagged it, and pushed it to Azure Container Registry (ACR), providing a centralised and secure repository for my container images.
To automate deployments, GitHub Actions was configured to handle authentication with ACR, ensuring that Docker images were automatically updated and pulled into the VM. The project also incorporated Azure Monitor & Log Analytics, allowing real-time monitoring of CPU, memory, and network usage.
Final Output: The result of this project is an Nginx web server running inside a Docker container on an Azure VM, with fully automated infrastructure deployment, configuration, and monitoring. The approach ensures scalability, repeatability, and minimal manual intervention.