This project is a basic Flask application designed to demonstrate web development with Python using the Flask framework. The application runs on Docker, allowing for portability and ease of deployment.
- Flask-based web application
- Dockerized for platform independence
- Environment variables for configuration
- Easy to set up and run locally
Before you start, ensure you have the following installed on your system:
Clone this repository to your local machine:
git clone git@github.com:<your-username>/<repository-name>.git
cd <repository-name>Create and activate a virtual environment:
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activateInstall dependencies:
pip install -r requirements.txt- Start the Flask application:
python app.py
- Open your browser and navigate to:
http://127.0.0.1:5000
- Build the Docker image:
docker build -t flask-app . - Run the Docker container:
docker run -d -p 5000:5000 flask-app
- Open your browser and navigate to:
http://127.0.0.1:5000
project-directory/
|-- app.py # Main Flask application file
|-- Dockerfile # Docker configuration
|-- requirements.txt # Python dependencies
|-- .gitignore # Git ignore file
|-- venv/ # Virtual environment (excluded from Git)
To deploy this application, ensure Docker is installed on the target machine and follow the steps under the With Docker section.
- Ensure you are using compatible versions of Flask and Werkzeug by updating your
requirements.txt:Flask==2.1.2 Werkzeug==2.1.2
- Check logs using:
docker logs <container_id>
- Ensure the correct ports are mapped.
- Ensure your SSH keys are correctly configured for GitHub. Refer to the GitHub SSH guide.
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature-name" - Push to the branch:
git push origin feature-name
- Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.