1.9 KiB
1.9 KiB
Flask Base Project
A starter template for Flask web applications with Docker support, user authentication, and deployment configurations.
Features
- User registration, login, and dashboard functionality
- Docker and Docker Compose for containerized environments
- SQLite database (with optional PostgreSQL support)
- Environment configuration via .env file
- Jinja2 templating with base HTML structure
- Git version control integration
Prerequisites
- Python 3.9+
- Docker 20.10+
- Docker Compose 2.4+
Installation
- Clone the repository:
git clone ssh://git@git.leoan.se:30009/andreas/flask-base.git
cd flask-base
- Install Python dependencies:
pip install -r requirements.txt
- Configure environment variables:
cp .env.example .env
# Edit .env with your configuration
Running the Application
Development Mode
flask run --port=5000 --debug
Production Mode with Docker
docker-compose up --build
Configuration
Essential environment variables in .env:
FLASK_APP=app.py
FLASK_ENV=production
DATABASE_URL=sqlite:///instance/app.db
SECRET_KEY=your-secret-key-here
Deployment
- Build production Docker image:
docker build -t flask-base:latest .
- Start container with database:
docker-compose -f docker-compose.prod.yml up -d
Project Structure
flask-base/
├── app.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── templates/
├── base.html
├── login.html
├── register.html
└── dashboard.html
Contributing
- Create your feature branch:
git checkout -b feature/your-feature
- Commit changes:
git commit -m 'Add some feature'
- Push to branch:
git push origin feature/your-feature
License
MIT License - see LICENSE for details