# Flask-Docker Application
A Dockerized Flask web application with SQLAlchemy integration, automated builds, and GitHub Actions deployment.
## Features
- Flask web framework
- SQLAlchemy for database operations
- Docker containerization
- Automated builds and pushes to Docker Hub on Git tags
- Gunicorn production server
## Prerequisites
- Python 3.9+
- Docker
- Docker Hub account
- Git
## Setup & Installation
### 1. Clone the repository
```bash
git clone git@github.com:org-navinku/flask-docker.git
cd flask-dockerpython3 -m venv venv
source venv/bin/activate # Linux/Macpip install -r requirements.txtexport FLASK_APP=app.py
flask rungunicorn --bind 0.0.0.0:5000 app:appdocker build -t navinkumarkc/flask-docker:v1.0.0 .docker container run -d -p 5000:5000 navinkumarkc/flask-docker:v1.0.0docker psdocker stop <container-id>docker login -u navinkumarkcdocker push navinkumarkc/flask-docker:v1.0.0The repository includes a GitHub Actions workflow that automatically builds and pushes the Docker image when you create a Git tag:
- Create and push a new tag:
git tag -a v1.1.0 -m "Version 1.1.0"
git push origin v1.1.0- The workflow will:
- Build the Docker image
- Tag it with both the version number and 'latest'
- Push to Docker Hub
The project uses these specific package versions:
Flask==2.0.3
Flask-SQLAlchemy==2.5.1
Flask-WTF==0.15.1
werkzeug==2.0.3
email-validator==2.1.1
SQLAlchemy==1.3.24
Flask-Chartjs==0.1.dev1
gunicorn
psycopg2-binary
- "externally-managed-environment" error: Use a virtual environment as shown above
- ModuleNotFoundError: Make sure all dependencies are installed from requirements.txt
- Docker push denied: Ensure you're logged in to Docker Hub with
docker login