monitoring-ng/compose.prometheus.yml

42 lines
1.4 KiB
YAML
Raw Normal View History

2023-02-07 12:15:40 +00:00
version: '3.8'
services:
prometheus:
2024-04-16 14:45:42 +00:00
image: prom/prometheus:v2.51.2
2023-02-07 12:15:40 +00:00
secrets:
2023-12-20 21:46:27 +00:00
- basic_auth
2023-02-07 12:15:40 +00:00
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"
2023-05-20 09:31:30 +00:00
- "--storage.tsdb.retention.time=${PROMETHEUS_RETENTION_TIME}"
2023-02-07 12:15:40 +00:00
networks:
- proxy
- internal
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
2023-05-20 09:31:30 +00:00
- "traefik.http.services.${STACK_NAME}-prometheus.loadbalancer.server.port=9090"
2023-02-12 18:06:30 +00:00
- "traefik.http.routers.${STACK_NAME}-prometheus.rule=Host(`prometheus.${DOMAIN}`)"
2023-02-07 12:15:40 +00:00
- "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}"
2023-02-11 15:36:26 +00:00
- "traefik.http.routers.${STACK_NAME}-prometheus.middlewares=basicauth@file"
2023-02-07 12:15:40 +00:00
configs:
prometheus_yml:
template_driver: golang
name: ${STACK_NAME}_prometheus_yml_${PROMETHEUS_YML_VERSION}
file: prometheus.yml.tmpl
volumes:
2023-12-20 21:46:27 +00:00
prometheus-data: