Dani App is a web application built with Flask and deployed using Docker and Terraform. It uses a PostgreSQL database and is designed to run in an Azure cloud environment.
- Web application using Flask
- PostgreSQL database integration
- Dockerized application for containerized deployment
- Infrastructure management using Terraform
- Docker
- Docker Compose
- Terraform
- Python 3.x
- pip
-
Clone the repository:
bash git clone https://github.com/yourusername/dani-app.git cd dani-app -
Create a virtual environment and activate it:
bash python3 -m venv venv source venv/bin/activate -
Install the required Python packages:
bash pip install -r requirements.txt
-
Create a
.envfile in the root directory and add your environment variables:bash cp .env.example .env -
Modify the
.envfile with your configuration details.
-
To run the application locally:
bash flask run -
Access the application at
http://localhost:5000.
app.py: Main application filerequirements.txt: Python dependenciesimport_resources.sh: Shell script for importing resources into Terraformdocker-compose.yml: Docker Compose configurationDockerfile: Docker image configurationmain.tf: Terraform configuration for infrastructurevariables.tf: Terraform variables
-
Build the Docker image:
bash docker build -t dani-app . -
Run the Docker container:
bash docker-compose up
-
Initialize Terraform:
bash terraform init -
Apply the Terraform configuration:
bash terraform apply
- Ensure all configurations in
main.tfandvariables.tfare set correctly. - Use the
import_resources.shscript to import existing resources into Terraform state:bash ./import_resources.sh - Apply Terraform configuration:
bash terraform apply
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
This project is licensed under the MIT License.
This README file provides a comprehensive overview of your project, including installation, configuration, usage, and development instructions.