1
0
Fork 0
nut-docker/Dockerfile

27 lines
663 B
Docker
Raw Normal View History

2021-01-09 00:23:46 +01:00
FROM debian:buster-slim
2021-01-02 16:54:47 +01:00
2021-01-13 11:34:43 +01:00
ENV TZ Etc/UTC
2021-01-08 12:50:14 +01:00
ENV NAME ups
2021-01-02 16:54:47 +01:00
ENV DRIVER usbhid-ups
ENV PORT auto
ENV POLLFREQ 5
ENV DESC UPS
2021-01-08 12:50:14 +01:00
ENV USERSSTRING #
2021-01-02 16:54:47 +01:00
2021-01-08 23:55:53 +01:00
#Installing default packages
2021-04-08 15:55:07 +02:00
RUN apt-get update
RUN apt-get install -y nut-server
2021-01-08 23:55:53 +01:00
#Apply configuration
RUN sed -i 's/MODE=none/MODE=netserver/g' /etc/nut/nut.conf \
2021-04-07 11:17:27 +02:00
&& /bin/echo "LISTEN 0.0.0.0 3493" >> /etc/nut/upsd.conf \
&& /bin/echo -e "[$NAME] \n driver = $DRIVER \n port = $PORT \n pollfreq = $POLLFREQ \n desc = $DESC" >> /etc/nut/ups.conf \
&& /bin/echo -e "$USERSSTRING" >> /etc/nut/upsd.users \
2021-01-08 23:55:53 +01:00
&& chgrp nut /etc/nut/*
2021-01-02 16:54:47 +01:00
COPY entrypoint.sh /
2021-04-07 11:59:49 +02:00
RUN chmod +x /entrypoint.sh
2021-01-02 16:54:47 +01:00
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 3493