Initial NUT relay setup
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y nut nut-client nut-server && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 3493
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -0,0 +1,9 @@
|
||||
services:
|
||||
lab-nut-relay:
|
||||
build: .
|
||||
container_name: lab-nut-relay
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3493:3493"
|
||||
volumes:
|
||||
- ./config:/etc/nut
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
chown -R nut:nut /etc/nut
|
||||
chmod 640 /etc/nut/upsd.users /etc/nut/upsd.conf 2>/dev/null || true
|
||||
|
||||
# Démarrer le driver dummy-ups en mode netclient (lit l'UPS distant via réseau)
|
||||
/usr/lib/nut/dummy-ups -a unifiups &
|
||||
|
||||
sleep 2
|
||||
|
||||
# Démarrer le serveur upsd (celui qui écoute sur 3493 pour tes clients)
|
||||
/usr/sbin/upsd -F &
|
||||
|
||||
# Garder le conteneur actif
|
||||
wait
|
||||
Reference in New Issue
Block a user