Initial commit
This commit is contained in:
6
stacks/monitoring/compose.yaml
Normal file
6
stacks/monitoring/compose.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
name: monitoring
|
||||
|
||||
include:
|
||||
- ./grafana.yaml
|
||||
- ./glance.yaml
|
||||
- ./portainer.yaml
|
||||
22
stacks/monitoring/glance.env
Normal file
22
stacks/monitoring/glance.env
Normal file
@@ -0,0 +1,22 @@
|
||||
# Variables for config (re-run docker compose up after changes).
|
||||
|
||||
# Auth (optional)
|
||||
MY_SECRET_TOKEN=123456
|
||||
|
||||
# *arr stack – API base URL and key (http from container)
|
||||
RADARR_URL=http://radarr.home
|
||||
RADARR_API_URL=http://radarr.home
|
||||
RADARR_KEY=512cab3acfe84420957a9c8585560f8f
|
||||
|
||||
SONARR_URL=http://sonarr.home
|
||||
SONARR_API_URL=http://sonarr.home
|
||||
SONARR_KEY=b3a84ef407ca42d99f5bc22fb8afc401
|
||||
|
||||
LIDARR_URL=http://lidarr.home
|
||||
LIDARR_API_URL=http://lidarr.home
|
||||
LIDARR_KEY=e0862cb9aa8c4c0f8115ec794c5bebc1
|
||||
|
||||
# Portainer (Settings → API → Enable API; endpoint ID from URL e.g. !#/2/docker → 2)
|
||||
PORTAINER_URL=http://portainer.home
|
||||
PORTAINER_ENDPOINT_ID=3
|
||||
PORTAINER_API_KEY=ptr_zmLlSaAbw8nQRoJlDRb006IDVtJLojneToSVNWJxo3c=
|
||||
13
stacks/monitoring/glance.env.example
Normal file
13
stacks/monitoring/glance.env.example
Normal file
@@ -0,0 +1,13 @@
|
||||
MY_SECRET_TOKEN=change_me
|
||||
RADARR_URL=http://radarr.home
|
||||
RADARR_API_URL=http://radarr.home
|
||||
RADARR_KEY=change_me
|
||||
SONARR_URL=http://sonarr.home
|
||||
SONARR_API_URL=http://sonarr.home
|
||||
SONARR_KEY=change_me
|
||||
LIDARR_URL=http://lidarr.home
|
||||
LIDARR_API_URL=http://lidarr.home
|
||||
LIDARR_KEY=change_me
|
||||
PORTAINER_URL=http://portainer.home
|
||||
PORTAINER_ENDPOINT_ID=1
|
||||
PORTAINER_API_KEY=change_me
|
||||
24
stacks/monitoring/glance.yaml
Normal file
24
stacks/monitoring/glance.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
services:
|
||||
glance:
|
||||
container_name: glance
|
||||
image: glanceapp/glance
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /srv/homelab/config/monitoring/glance:/app/config
|
||||
- /srv/homelab/data/monitoring/glance/assets:/app/assets
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/custom-ca.crt:ro
|
||||
- /srv/media:/srv/media:ro
|
||||
- /backup:/backup:ro
|
||||
ports:
|
||||
- "9090:8080"
|
||||
env_file:
|
||||
- ./glance.env
|
||||
environment:
|
||||
- SSL_CERT_FILE=/etc/ssl/certs/custom-ca.crt
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "5"
|
||||
98
stacks/monitoring/grafana.yaml
Normal file
98
stacks/monitoring/grafana.yaml
Normal file
@@ -0,0 +1,98 @@
|
||||
# One-time permissions (run on host):
|
||||
# sudo chown -R 65534:65534 /srv/homelab/data/monitoring/prometheus
|
||||
# sudo chown -R 10001:10001 /srv/homelab/data/monitoring/loki
|
||||
# sudo chown -R 472:472 /srv/homelab/data/monitoring/grafana
|
||||
#
|
||||
services:
|
||||
cadvisor:
|
||||
image: gcr.io/cadvisor/cadvisor:latest
|
||||
container_name: cadvisor
|
||||
ports:
|
||||
- "8088:8080"
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /var/run:/var/run:ro
|
||||
- /sys:/sys:ro
|
||||
- /var/lib/docker:/var/lib/docker:ro
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "5"
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: prometheus
|
||||
extra_hosts:
|
||||
- "metrics.home:192.168.1.70"
|
||||
ports:
|
||||
- "9094:9090"
|
||||
volumes:
|
||||
- /srv/homelab/config/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- /srv/homelab/data/monitoring/prometheus:/prometheus
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "5"
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
user: "472:65534"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
environment:
|
||||
- GF_FEATURE_TOGGLES_KUBERNETESDASHBOARDS=false
|
||||
depends_on:
|
||||
- loki
|
||||
- prometheus
|
||||
ports:
|
||||
- "3034:3000"
|
||||
volumes:
|
||||
- /srv/homelab/data/monitoring/grafana:/var/lib/grafana
|
||||
- /srv/homelab/config/monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "5"
|
||||
|
||||
loki:
|
||||
image: grafana/loki:2.9.0
|
||||
container_name: loki
|
||||
ports:
|
||||
- "3100:3100"
|
||||
command: -config.file=/etc/loki/config.yaml
|
||||
volumes:
|
||||
- /srv/homelab/config/monitoring/loki-config.yaml:/etc/loki/config.yaml:ro
|
||||
- /srv/homelab/data/monitoring/loki:/loki
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "5"
|
||||
|
||||
promtail:
|
||||
image: grafana/promtail:2.9.0
|
||||
container_name: promtail
|
||||
command: -config.file=/etc/promtail/config.yaml
|
||||
depends_on:
|
||||
- loki
|
||||
volumes:
|
||||
- /srv/homelab/config/monitoring/promtail-config.yaml:/etc/promtail/config.yaml:ro
|
||||
- /var/log:/var/log:ro
|
||||
- /etc/machine-id:/etc/machine-id:ro
|
||||
- /var/lib/docker/containers:/var/lib/docker/containers:ro
|
||||
- /run/log/journal:/run/log/journal:ro
|
||||
- /var/log/journal:/var/log/journal:ro
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "5"
|
||||
18
stacks/monitoring/portainer.yaml
Normal file
18
stacks/monitoring/portainer.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
services:
|
||||
portainer:
|
||||
container_name: portainer
|
||||
image: portainer/portainer-ce:lts
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /srv/homelab/data/portainer/data:/data
|
||||
ports:
|
||||
- "9443:9443"
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- TRUSTED_ORIGINS=portainer.home
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "5"
|
||||
Reference in New Issue
Block a user