initial commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
cache/
|
||||
config/
|
||||
jellyfin-monitor.log
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
services:
|
||||
jellyfin:
|
||||
image: jellyfin/jellyfin
|
||||
container_name: jellyfin
|
||||
network_mode: 'host'
|
||||
volumes:
|
||||
- ./config:/config
|
||||
- ./cache:/cache
|
||||
- /opt/argento/smb/media/Movies:/media/movies
|
||||
- /opt/argento/smb/media/TV:/media/tv
|
||||
- /dev/dri:/dev/dri:rw
|
||||
runtime: nvidia
|
||||
#deploy:
|
||||
# resources:
|
||||
# reservations:
|
||||
# devices:
|
||||
# - driver: nvidia
|
||||
# count: all
|
||||
# capabilities: [gpu]
|
||||
restart: 'unless-stopped'
|
||||
# Optional - alternative address used for autodiscovery
|
||||
environment:
|
||||
- JELLYFIN_PublishedServerUrl=https://jellyfin.timothykim.net
|
||||
- NVIDIA_VISIBLE_DEVICES=all
|
||||
- NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
|
||||
# Optional - may be necessary for docker healthcheck to pass if running in host network mode
|
||||
extra_hosts:
|
||||
- 'host.docker.internal:host-gateway'
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "nvidia-smi > /dev/null 2>&1 || exit 1"]
|
||||
interval: 60s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check GPU status in Jellyfin container
|
||||
output=$(docker exec jellyfin nvidia-smi 2>&1)
|
||||
exit_code=$?
|
||||
|
||||
# Log file location
|
||||
LOG_FILE="/opt/docker/jellyfin/jellyfin-monitor.log"
|
||||
|
||||
# Check if command failed or output contains "error" (case insensitive)
|
||||
if [ $exit_code -ne 0 ] || echo "$output" | grep -iq "error"; then
|
||||
echo "$(date): GPU error detected." | tee -a "$LOG_FILE"
|
||||
echo $output | tee -a "$LOG_FILE"
|
||||
echo "$(date): Restarting Jellyfin..." | tee -a "$LOG_FILE"
|
||||
cd /opt/docker/jellyfin/
|
||||
docker compose restart
|
||||
echo "$(date): Jellyfin restarted successfully" | tee -a "$LOG_FILE"
|
||||
else
|
||||
echo "$(date): GPU status OK"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user