This project sets up a Flask application with a MySQL database, routed through, Nginx as a reverse proxy, using Docker Compose for container orchestration.
- 🐍 Flask – Backend framework
- 🐬 MySQL – Database
- 🌐 Nginx – Reverse proxy
- 🐳 Docker Compose – Manages multi-container applications
✅ Containerized Flask backend and MySQL database using Docker
✅ Configured Nginx as a reverse proxy to route traffic to the Flask app
✅ Managed multi-container setup using Docker Compose
✅ Environment variables used to configure database connection
- Created a Flask application with basic endpoints.
- Configured the app to connect to the MySQL database.
- Created Dockerfiles for Flask and Nginx.
- Built and managed containers using Docker Compose.
- Created a MySQL container with environment variables for user and database creation.
- Configured Flask to connect to the MySQL database.
- Configured Nginx as a reverse proxy for the Flask app.
- Set up Docker Compose to expose the Nginx container on port 8080.
- Clone the repository:
git clone https://github.com/DharmikDevops/docker-compose-backend.git
cd docker-compose-backend- Start the containers:
docker-compose up -d-
Access the Flask app at:
🌐
http://localhost:8080 -
Stop the containers:
docker_compose down✅ Setting up multi-container apps with Docker Compose
✅ Configuring Nginx as a reverse proxy
✅ Docker container networking
➡️ Integrate Jenkins for CI/CD
Feel free to reach out on www.linkedin.com/in/dharmik1904 for any question!