Flask Application Template with Docker Support
341
A production-ready Flask application template with authentication, Docker support, and CI/CD infrastructure. This template provides a solid foundation for building web applications with modern deployment practices.
Clone the repository
git clone <your-repo-url>
cd flask-app-template
Start the application
docker-compose up --build -d
Access the application
http://localhost:5000user / passwordInstall dependencies
pip install -r requirements.txt
Run the application
python app.py
Configure the application using environment variables:
| Variable | Default | Description |
|---|---|---|
APP_USERNAME | user | Authentication username |
APP_PASSWORD | password | Authentication password |
SECRET_KEY | your-secret-key-change-this-in-production | Flask session secret |
environment:
- APP_USERNAME=myuser
- APP_PASSWORD=mypassword
- SECRET_KEY=your-very-secure-secret-key
GET / - Main application page (requires authentication)GET /login - Login pagePOST /login - Authentication endpointGET /logout - Logout endpointGET /health - Health check endpointGET /api/data - Sample API endpoint (requires authentication)./scripts/test-all
# Python unit tests
python -m pytest tests/ -v
# Import verification
python tests/test_imports.py
# Docker container tests
./test-docker/test-container.sh
โโโ app.py # Main Flask application
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Multi-stage Docker build
โโโ docker-compose.yml # Development compose file
โโโ gunicorn.conf.py # Production server configuration
โโโ templates/ # HTML templates
โ โโโ index.html # Main page
โ โโโ login.html # Login page
โโโ tests/ # Test suite
โโโ scripts/ # Automation scripts
โโโ test-docker/ # Container testing
export APP_USERNAME="your-secure-username"
export APP_PASSWORD="your-secure-password"
export SECRET_KEY="your-very-long-random-secret-key"
This template provides a solid foundation for Flask applications. Customize it according to your specific needs:
app.pytemplates/This template is provided as-is for educational and development purposes.
Content type
Image
Digest
sha256:49e28eb81โฆ
Size
46.3 MB
Last updated
5 months ago
docker pull nerwander/flask-app-template