This repository contains a simple Flask application that demonstrates how to connect to a MySQL database for simple user authentication.
- Docker installed on your machine.
-
Clone this repository:
git clone https://github.com/mishragauravgm/docker-flask-mysql.git cd docker-flask-mysql
-
Run the Docker containers:
docker-compose up
-
Access the application:
Open a web browser and go to http://localhost:5005/ to test the login functionality.
- The Flask application (
app.py
) provides information from a MySQL database. - The MySQL database is initialized with a sample user table (
users
) containing one user for testing.
app.py
: Contains the Flask application code.init.sql
: Initializes the MySQL database with a sample table and user for testing.Dockerfile
: Builds the Docker image for the Flask app and sets up MySQL.requirements.txt
: Lists the required Python packages for the Flask app.docker-compose.yml
: Configures the services (Flask app and MySQL) to run together using Docker Compose.
Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.
This project is licensed under the MIT License.