113 lines
3.3 KiB
Django/Jinja
113 lines
3.3 KiB
Django/Jinja
{% import 'contrib/compose_helpers.j2' as helpers with context %}
|
|
|
|
networks:
|
|
{{ helpers.default_network(251) | indent(2) }}
|
|
|
|
services:
|
|
grafana:
|
|
{# image: grafana/grafana:latest#}
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: grafana
|
|
labels:
|
|
- {{ helpers.traefik_labels('grafana', port='3000') | indent(6) }}
|
|
restart: unless-stopped
|
|
# Needed to make config files readable (not anymore, TODO: remove)
|
|
user: "{{ remote_uid }}"
|
|
volumes:
|
|
- {{ base_volume_path }}/monitoring/grafana:/var/lib/grafana
|
|
- ./grafana_config/grafana.ini:/etc/grafana/grafana.ini:ro
|
|
- ./grafana_config/datasources:/etc/grafana/provisioning/datasources:ro
|
|
{# - ./grafana_config:/etc/grafana:ro#}
|
|
|
|
loki:
|
|
image: grafana/loki:3.5
|
|
container_name: loki
|
|
restart: unless-stopped
|
|
# Needed to make config files readable (not anymore, TODO: remove)
|
|
user: "{{ remote_uid }}"
|
|
command:
|
|
- -config.file=/etc/loki/loki-config.yaml
|
|
# Port forward is needed because not possible to resolve the container name from the host network
|
|
ports:
|
|
- "127.0.0.1:3100:3100"
|
|
- "[::1]:3100:3100"
|
|
volumes:
|
|
- {{ base_volume_path }}/monitoring/loki:/loki
|
|
- ./loki_config:/etc/loki:ro
|
|
tmpfs:
|
|
- /tmp/loki
|
|
|
|
promtail:
|
|
image: grafana/promtail:3.5
|
|
container_name: promtail
|
|
restart: unless-stopped
|
|
command:
|
|
- -config.file=/etc/promtail/promtail-config.yaml
|
|
ports:
|
|
- 514:514
|
|
volumes:
|
|
- ./promtail_config:/etc/promtail:ro
|
|
- /var/log:/var/log:ro
|
|
tmpfs:
|
|
- /tmp
|
|
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: prometheus
|
|
restart: unless-stopped
|
|
# Needed to make config files readable (not anymore, TODO: remove)
|
|
user: "{{ remote_uid }}"
|
|
command:
|
|
- --config.file=/etc/prometheus/prometheus.yml
|
|
- --storage.tsdb.retention.time=30d
|
|
volumes:
|
|
- ./prometheus_config:/etc/prometheus:ro
|
|
- {{ base_volume_path }}/monitoring/prometheus_configs:/etc/prometheus/extra:ro
|
|
- {{ base_volume_path }}/monitoring/prometheus:/prometheus
|
|
|
|
node-exporter:
|
|
image: prom/node-exporter:latest
|
|
container_name: node-exporter
|
|
restart: unless-stopped
|
|
network_mode: host
|
|
pid: host
|
|
volumes:
|
|
- /:/host:ro,rslave
|
|
|
|
cadvisor:
|
|
image: gcr.io/cadvisor/cadvisor:latest
|
|
container_name: cadvisor
|
|
restart: unless-stopped
|
|
command:
|
|
- --docker_only=true
|
|
- --store_container_labels=false
|
|
- --whitelisted_container_labels=com.docker.compose.project,com.docker.compose.service
|
|
- --enable_metrics=cpu,cpuLoad,diskIO,memory,network,oom_event,process
|
|
volumes:
|
|
- /:/rootfs:ro
|
|
- /var/run:/var/run:rw
|
|
- /sys:/sys:ro
|
|
- /var/lib/docker/:/var/lib/docker:ro
|
|
|
|
influxdb:
|
|
image: influxdb:2.7-alpine
|
|
container_name: influxdb
|
|
labels:
|
|
- {{ helpers.traefik_labels('influxdb', port='8086') | indent(6) }}
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env.influxdb
|
|
volumes:
|
|
- {{ base_volume_path }}/monitoring/influxdb:/var/lib/influxdb2
|
|
|
|
uptime-kuma:
|
|
image: louislam/uptime-kuma:1
|
|
container_name: uptime-kuma
|
|
labels:
|
|
- {{ helpers.traefik_labels('uptime', port='3001', auth=true) | indent(6) }}
|
|
restart: unless-stopped
|
|
volumes:
|
|
- {{ base_volume_path }}/monitoring/uptime-kuma:/app/data
|