Production-ready DevOps environment template featuring
Flask application, GitHub Actions CI/CD pipeline, Dockerized deployment, and real-time Prometheus + Grafana monitoring.
- 🧩 Modular structure — clean separation between
app,monitoring, andscripts - 🐳 Fully containerized — runs entirely via Docker Compose
- 🔄 Automated CI/CD — GitHub Actions builds and pushes to Docker Hub
- 📊 Real-time monitoring — Prometheus + Grafana + cAdvisor
- 🚀 One-command deploy —
./scripts/deploy.sh - 🧠 Perfect for learning, demos, or production bootstrap
- 🎨 Dark Grafana dashboard — presentation-ready visuals
A fully integrated DevOps infrastructure template including:
- Backend demo app: Flask (
flaskr) - CI/CD: GitHub Actions (build & push Docker image)
- Deployment:
deploy.sh— one command for updates - Monitoring: Prometheus + Grafana + cAdvisor
- Config files:
docker-compose.yml,prometheus.yml, and Grafana templates
📁 Project Structure (click to expand)
📦 packaged_solution
├── 🚀 app
│ ├── ⚙️ deploy.sh
│ ├── 🐳 docker-compose.yml
│ ├── 🧱 Dockerfile
│ ├── 🧩 flaskr
│ │ ├── 🔐 auth.py
│ │ ├── 📰 blog.py
│ │ ├── 🗄️ db.py
│ │ ├── 📄 __init__.py
│ │ ├── 🧾 schema.sql
│ │ ├── 🎨 static
│ │ │ └── style.css
│ │ └── 🖼️ templates
│ │ ├── 🔑 auth
│ │ │ ├── login.html
│ │ │ └── register.html
│ │ ├── 🧩 base.html
│ │ └── 📰 blog
│ │ ├── create.html
│ │ ├── index.html
│ │ └── update.html
│ ├── 📜 LICENSE.txt
│ ├── 🧾 pyproject.toml
│ ├── 📘 README.md
│ ├── 📗 README.rst
│ └── 🧪 tests
│ ├── conftest.py
│ ├── data.sql
│ ├── test_auth.py
│ ├── test_blog.py
│ ├── test_db.py
│ └── test_factory.py
├── 🧰 ci
├── 📚 docs
├── 📊 monitoring
│ ├── 🐳 docker-compose.yml
│ ├── 📈 grafana
│ └── 📡 prometheus
│ └── prometheus.yml
└── ⚙️ scripts
└── deploy.sh
Legend
Emoji Meaning Description 📦 Root folder Main project directory 🚀 Application layer Flask app, Docker build, and dependencies 🧩 Module / Template Flask components or HTML templates ⚙️ Script / Tooling Deployment or automation scripts 🐳 Docker / Compose Container and environment configuration 🧾 Config / Manifest Application configuration or schema 🧪 Tests Pytest test cases and fixtures 📊 Monitoring stack Prometheus, Grafana, cAdvisor setup 📡 Prometheus Metrics collection and targets config 📈 Grafana Dashboards and visualization templates 📚 Docs Documentation, images, or diagrams 🧰 CI/CD GitHub Actions, pipelines, automation 📘 / 📗 / 📜 Docs & License README and license files
1️⃣ Run the application and monitoring stack
cd ~/devops_practice/packaged_solution/monitoring
docker compose up -d
# or launch the full stack
# docker compose -f docker-compose.full.yml up -d
2️⃣ Deploy the latest image
cd ~/devops_practice/packaged_solution/scripts
./deploy.sh
3️⃣ Access points
- Flask App: http://localhost:5000
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000 (admin / admin)
The included dashboard (flask_monitoring_dashboard.json) is optimized for aggregated metrics from cAdvisor and Prometheus.
Legend Settings
| Panel | Legend | Description |
|---|---|---|
| CPU Usage (%) | {{job}} |
Displays Prometheus job |
| Memory Usage (MB) | Total |
Aggregated container memory |
| Network Traffic | Receive / Transmit |
Inbound and outbound network |
| Uptime | Uptime |
Process uptime metric |
| Targets | {{instance}} |
Lists monitored services |
Recommended Visualization
- Theme: Dark
- Time range:
Last 1 hour - Refresh interval: 5s
- Legend placement: Table (bottom)
- Color thresholds: 🟢 Normal • 🟡 Warning • 🔴 Critical
This template demonstrates a complete DevOps lifecycle — from CI/CD automation to monitoring and deployment orchestration.
Ideal for:
- 🔍 Learning modern DevOps practices
- 💼 Building a professional GitHub portfolio
- 🧩 Rapid prototyping of real infrastructure setups
devops • docker • flask • prometheus • grafana • monitoring • cicd • template
Made with ❤️ by Eldor Zufarov