Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/galanr12/invadeapp
Django/Python/Terraform/Docker/Azure This project is a small application written in Django and deployed automatically on Cloud (Azure) with DevOps tools.
https://github.com/galanr12/invadeapp
azure azurecontainerregistry django docker postgresql-database python terraform webapp
Last synced: 24 days ago
JSON representation
Django/Python/Terraform/Docker/Azure This project is a small application written in Django and deployed automatically on Cloud (Azure) with DevOps tools.
- Host: GitHub
- URL: https://github.com/galanr12/invadeapp
- Owner: GalanR12
- Created: 2024-09-08T14:32:55.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T14:41:06.000Z (2 months ago)
- Last Synced: 2024-10-14T20:40:19.049Z (24 days ago)
- Topics: azure, azurecontainerregistry, django, docker, postgresql-database, python, terraform, webapp
- Language: HTML
- Homepage:
- Size: 2.99 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Invade Application
## DescriptionThis project is a small application written in Django which is deployed automatically on Cloud (Azure) with DevOps tools. The purpose of this application is to track a certain aspect of one popular computer game. The main goal of this project was to train the deployment of web applications, containerization, infrastructure as code or CI/CD processes.
## Application stack
* Backend: Django (Python)
* Container: Docker (Azure Container Registry)
* Database: PostgreSQL
* Cloud: Azure (Web App + PostgreSQL flexible server)
* Infrastructure as Code: Terraform
* CI/CD: Github Actions## Project Schema
Terraform is handling infrastructure creation and application deployment. At the beggining terraform uses docker commands to build, tag and push image to Azure Container Registry (which is also created by tf earlier). After that, Web App is created with image from ACR and connected to the Postgresql database.
![alt text](repo_images/diagram.png)
## Prerequisites
Make sure you have installed all of the following prerequisites on your development machine:
* Git - [Download & Install Git](https://git-scm.com/downloads). OSX and Linux machines typically have this already installed.
* Terraform (version 1.9.5) - [Download & Install Terraform](https://developer.hashicorp.com/terraform/install)
* Docker Engine - [Download & Install Docker Engine](https://docs.docker.com/engine/install/)## Application starting
* Log in to Azure```
az login --tenant --use-device-code
```
* Set your subscrpiton ID in main.tf file```ruby
# Configure the Microsoft Azure Provider
provider "azurerm" {
subscription_id = ""
features {}
}
```
* Create infrastructure, build application and deploy it to the Web App```
terraform init
terraform apply -auto-approve
```* You can specify database credentials using terraform.tfvars file
* You should see application hosted on address https://invadeapp.azurewebsites.net/![alt text](repo_images/website.png)
## Enable CI/CD with Github Actions
* In order to enable CI/CD you need to need to set up 3 secrets in Github respository
- ACR_USERNAME
- ACR_PASSWORD
- PUBLISH_PROFILE* You can get ACR_USERNAME and ACR_PASSWORD using following commands
```
terraform output acr_admin_username
terraform output acr_admin_password
```
* You can receive PUBLISH_PROFILE value by clicking "Download publish profile" in Web App blade![alt text](repo_images/publish_profile.png)
* Add secrets mentioned above and you ready to go!
![alt text](repo_images/secrets.png)