Files
monitoring-ng/compose.prometheus.yml
faunoanddannygroenewegen ff56438d7c BREAKING CHANGES: replace promtail and cadvisor for alloy (#21)
closes #20

---------

Co-authored-by: Danny Groenewegen <danny@ecommons.space>
Reviewed-on: coop-cloud/monitoring-ng#21
Reviewed-by: ammaratef45 <ammaratef45@proton.me>
Reviewed-by: Danny Groenewegen <247+dannygroenewegen@noreply.git.coopcloud.tech>
Co-authored-by: f <f@sutty.nl>
2026-09-02 22:57:39 +00:00

50 lines
1.6 KiB
YAML

version: '3.8'
services:
prometheus:
image: prom/prometheus:v3.12.0
secrets:
- basic_auth
volumes:
- prometheus-data:/prometheus:rw
configs:
- source: prometheus_yml
target: /etc/prometheus/prometheus.yml
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
- "--storage.tsdb.retention.time=${PROMETHEUS_RETENTION_TIME}"
- "--web.enable-remote-write-receiver"
networks:
- proxy
- internal
healthcheck:
test: "wget -q --spider http://localhost:9090/-/healthy || exit 1"
interval: 5s
timeout: 10s
retries: 3
start_period: 30s
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.swarm.network=proxy"
- "traefik.http.services.${STACK_NAME}-prometheus.loadbalancer.server.port=9090"
- "traefik.http.routers.${STACK_NAME}-prometheus.rule=Host(`prometheus.${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-prometheus.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-prometheus.tls=true"
- "traefik.http.routers.${STACK_NAME}-prometheus.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}-prometheus.middlewares=basicauth@file"
configs:
prometheus_yml:
template_driver: golang
name: ${STACK_NAME}_prometheus_yml_${PROMETHEUS_YML_VERSION}
file: prometheus.yml.tmpl
volumes:
prometheus-data: