Environment_Monitoring/docker-stack-monitoring.yml
Murat ÖZDEMİR 735d957dfa feat(monitoring): replace Dozzle with full observability stack
Replace the single-purpose Dozzle log viewer with a comprehensive monitoring
stack covering metrics, container telemetry, and persistent log aggregation.

Stack changes (docker-stack-service.yml -> docker-stack-monitoring.yml):
- remove Dozzle service and dozzle_users Docker secret
- add Portainer CE + portainer-agent (Swarm management UI)
- add node-exporter (global) — host CPU, memory, disk, network metrics
- add cAdvisor (global) — per-container resource usage metrics
- add Loki (replicated, service node) — persistent log storage, 31-day retention
- add Promtail (global) — Docker service discovery; ships logs with service,
  stack, container, and project labels; sends to Loki
- rename stack to iklimco-monitoring; add loki-vl persistent volume

Workflow (.gitea/workflows/deploy-prod.yml -> deploy-monitoring-prod.yml):
- rename file and add paths filter (Environment_Monitoring/**)
- remove Dozzle secret creation and auth handling
- add IMAGE_LOKI / IMAGE_PROMTAIL; clean up legacy dozzle_users Docker secret
- update SWAG step to loop swag/site-confs/*.conf.tpl (portainer only)
- remove DOZZLE_SUBDOMAIN; remove dozzle DNS record; keep portainer DNS
- replace "Wait for Dozzle" with "Wait for Loki"

SWAG:
- remove swag/dozzle.conf.tpl (Dozzle no longer in stack)
- add swag/site-confs/portainer.conf.tpl (moved from main repo template dir;
  monitoring stack manages its own SWAG configs independently)
- remove init/apisix-dozzle.sh (superseded by SWAG reverse proxy)

README:
- rewrite in Turkish; document Portainer, node-exporter, cAdvisor, Loki, Promtail
- add Grafana log viewing guide: datasource setup, label filter table, LogQL
  examples, metric-log correlation workflow, adding log panels to dashboards

Requires IMAGE_LOKI and IMAGE_PROMTAIL to be defined in .env and
corresponding custom images (build/loki/, build/promtail/) pushed to Harbor.
2026-06-24 21:21:02 +03:00

119 lines
2.4 KiB
YAML

services:
portainer-agent:
image: portainer/agent:lts
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
networks:
- portainer-net
deploy:
mode: global
placement:
constraints:
- node.platform.os == linux
restart_policy:
condition: any
delay: 5s
labels:
project: co.iklim
portainer:
image: portainer/portainer-ce:lts
command: -H tcp://tasks.portainer-agent:9001 --tlsskipverify
volumes:
- portainer_data:/data
networks:
- portainer-net
- iklimco-net
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
restart_policy:
condition: any
delay: 5s
labels:
project: co.iklim
node-exporter:
image: prom/node-exporter:latest
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--path.rootfs=/rootfs'
volumes:
- /:/rootfs:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
networks:
- iklimco-net
deploy:
mode: global
restart_policy:
condition: any
delay: 5s
labels:
project: co.iklim
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
networks:
- iklimco-net
deploy:
mode: global
restart_policy:
condition: any
delay: 5s
labels:
project: co.iklim
loki:
image: ${CUSTOM_IMAGE_REGISTRY}${IMAGE_LOKI}
volumes:
- loki-vl:/loki
networks:
- iklimco-net
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.labels.type == service
restart_policy:
condition: any
delay: 5s
labels:
project: co.iklim
promtail:
image: ${CUSTOM_IMAGE_REGISTRY}${IMAGE_PROMTAIL}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- iklimco-net
deploy:
mode: global
restart_policy:
condition: any
delay: 5s
labels:
project: co.iklim
networks:
portainer-net:
driver: overlay
attachable: true
iklimco-net:
external: true
volumes:
portainer_data:
loki-vl: