How celiagmqrz/fluent-bit_loki_grafana__docker-drupal works
Project Type and Purpose
• Although it hosts a Drupal application stack (web server + database), the README makes clear the focus is on the logging pipeline.
File Structure Analysis
• Top-level files:
• .env / docker-compose.yaml – orchestration and environment variables
• build_images.sh – builds custom container images (Drupal, Nginx, MySQL)
• Service folders:
• nginx/ – Dockerfile, entrypoint scripts, and Nginx configuration template
• drupal/ – Dockerfile for the Drupal container (PHP-FPM)
• mysql/ – Dockerfile for MySQL
• fluent-bit/ – Fluent-Bit config files (fluent-bit.conf, parsers.conf)
• loki/ – Loki config (loki.yml)
• grafana/ – Grafana provisioning (datasource YAML)
• The docker-compose.yaml ties these services together on a single network (milocal).
Key Components and Interactions
a. User → Nginx container (ports 80/443) → Drupal/PHP-FPM → MySQL (port 3306)
b. Docker logging driver on each service (nginx, drupal, mysql) emits logs to Fluent-Bit’s forward input (TCP/UDP 24224).
c. Fluent-Bit container reads incoming logs ([INPUT] Name forward) and pushes them to Loki via HTTP (loki/api/v1/push).
d. Loki stores, indexes, and exposes logs via its HTTP API on port 3100.
e. Grafana container queries Loki (configured via datasource.yml) and visualizes logs on dashboards (port 3000).
Architectural Patterns and Principles
• Micro-services in containers, each single-responsibility (web, application, database, logging, storage, visualization).
• Log-aggregation pipeline pattern: side-car/collector (Fluent-Bit) → log store (Loki) → visualization (Grafana).
• Separation of concerns: application workload vs. monitoring/observability workload.
Step-by-Step
6) Volume mounts for MySQL data and Drupal files if needed.