Files
p42.s-m/docker-compose.yml
T
guyg1474andClaude Opus 5.5 c6eef176a2 P42-S.M.: Server-Monitoring-Agent als Docker-Container
Misst CPU, RAM, Swap, Platten, Netzwerk, Temperaturen und Prozesse des
Hosts und liefert sie als JSON-API (/api/metrics, /api/history) für das
P42-Dashboard. Nur Python-Standardbibliothek, Token-geschützt,
Container ohne Root und mit schreibgeschütztem Dateisystem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 15:15:01 +02:00

32 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
sm:
build: .
image: p42-sm
container_name: p42-sm
restart: unless-stopped
user: "${SM_UID:-1000}"
ports:
# Standardmäßig nur vom Server selbst erreichbar. Port/Adresse in .env änderbar (siehe .env.example).
- "${SM_BIND:-127.0.0.1}:${SM_PORT:-9142}:9142"
environment:
TZ: Europe/Berlin
SM_TOKEN: "${SM_TOKEN:?SM_TOKEN fehlt in .env – deploy/update-docker.sh legt ihn an}"
SM_INTERVAL: "${SM_INTERVAL:-5}"
SM_HISTORY: "${SM_HISTORY:-720}"
volumes:
# Messwerte des Hosts – alles nur lesend
- /proc:/host/proc:ro
# Für Plattenbelegung (auch später eingehängte Platten, daher rslave) und os-release
- /:/host/root:ro,rslave
# Der Container selbst braucht keinerlei Rechte und schreibt nichts
read_only: true
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
networks: [default, p42]
networks:
# Gemeinsames Netz für P42-Container: das Dashboard (P42-F.W.) erreicht diesen Dienst darin
# unter http://p42-sm:9142, ohne dass ein Port nach außen offen sein muss.
p42:
name: p42