Skip to content

A complete containerized DevOps stack with Flask, MySQL, Nginx, and Monitoring Stack

License

Notifications You must be signed in to change notification settings

atkaridarshan04/docker-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Stack

A comprehensive Docker-based application stack featuring a Flask web application with MySQL database, NGINX reverse proxy, and integrated observability tools for monitoring and logging.

🏗️ Architecture Overview

Docker Stack Architecture Docker Stack Architecture - Core components and data flow

This project implements a complete containerized application stack with built-in observability:

  • Application Layer: Flask web application with MySQL database
  • Reverse Proxy: NGINX for load balancing and routing
  • Metrics Collection: Prometheus with Blackbox Exporter for application monitoring
  • Log Aggregation: Grafana Loki for centralized logging
  • Data Collection: Grafana Alloy for unified telemetry collection
  • Visualization: Grafana dashboards for metrics and logs

📋 Services

Service Port Description
NGINX 80 Reverse proxy and load balancer
Flask App 5000 Python web application
MySQL 3306 Database server
Grafana 3000 Visualization and dashboards
Prometheus 9090 Metrics collection and storage
Loki 3100 Log aggregation system
Alloy 12345 Telemetry data collection agent
Blackbox Exporter 9115 Application health monitoring

🚀 Quick Start

1. Clone and Start

cd docker-stack

# Start all services
./scripts/start.sh

2. Access Services

🖥️ Service Interfaces

Flask Application

Flask Application Main Flask web application interface

Prometheus Monitoring

Prometheus Targets Prometheus target monitoring and health status

Grafana Alloy

Alloy Interface Grafana Alloy Components Graph

Alloy Graph Alloy data flow and processing graph

Blackbox Exporter

Blackbox Exporter Blackbox exporter metrics and probe results

📊 Monitoring Dashboards

The stack includes pre-configured Grafana dashboards for comprehensive observability:

System Monitoring

  • Node Exporter Dashboard (ID: 1860) - System metrics and performance
  • Docker Container Dashboard (ID: 193) - Container resource usage
  • MySQL Dashboard (ID: 7587) - Database performance metrics
  • Blackbox Exporter Dashboard (ID: 13639) - Application uptime monitoring

Dashboard Screenshots

Grafana Dashboards Available Grafana dashboards overview

Grafana DataSources Configured Grafana data sources

Node Exporter Dashboard System metrics and performance monitoring

Docker Container Dashboard Container resource usage and health

Blackbox Exporter Dashboard Application uptime and health monitoring

Log Analysis Centralized log analysis with Loki

Metrics Drilldown Detailed metrics analysis and correlation

🔍 Features

Application Stack

  • Flask Web Application: Python-based web server with health endpoints
  • MySQL Database: Persistent data storage with initialization scripts
  • NGINX Reverse Proxy: Load balancing and request routing
  • Docker Orchestration: Multi-container deployment with health checks

Observability

  • Metrics Collection: Application and system performance monitoring
  • Log Aggregation: Centralized logging from all services
  • Health Monitoring: Automated service health checks and alerts
  • Visualization: Real-time dashboards and analytics

Security

  • Docker Secrets: Production-grade secrets management for database credentials
  • Read-only Mounts: Secrets mounted as read-only files in containers
  • Least Privilege: Secrets only accessible to services that need them

See secrets/README.md for implementation details.

Domain & SSL Management

  • NGINX Proxy Manager: Web-based reverse proxy management with SSL automation
  • Let's Encrypt Integration: Automatic SSL certificate generation and renewal
  • Custom Domain Support: Easy domain configuration and routing

NGINX Proxy Manager Interface

Grafana Blackbox Integration Grafana dashboard showing Blackbox monitoring through proxy

For detailed setup and results, see Domain and SSL Configuration.

Clean Up

./scripts/stop.sh

About

A complete containerized DevOps stack with Flask, MySQL, Nginx, and Monitoring Stack

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages