infra/roles/prometheus/templates/docker-compose.yml.j2
Jeremie Fraeys dbe7b1b6b2
feat(docker): add timezone mounts to all containers for log sync
Add /etc/localtime:/etc/localtime:ro volume mount to:
- alertmanager, authelia, traefik
- exporters (node-exporter, cadvisor)
- fail2ban, lldap, postfix
- forgejo, forgejo_runner
- grafana, loki, prometheus
- watchtower, app_core (postgres, redis)

Ensures container logs use host timezone for consistent timestamps.
2026-03-06 15:13:52 -05:00

36 lines
820 B
Django/Jinja

services:
prometheus:
image: prom/prometheus:v3
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=15d
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./alerts.yml:/etc/prometheus/alerts.yml:ro
- prometheus_data:/prometheus
- /etc/localtime:/etc/localtime:ro
networks:
- monitoring
- proxy
ports:
- "127.0.0.1:9090:9090"
restart: unless-stopped
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp:noexec,nosuid,size=50m
labels:
- com.centurylinklabs.watchtower.enable=true
volumes:
prometheus_data:
networks:
monitoring:
external: true
name: monitoring
proxy:
external: true