-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (22 loc) · 1.03 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM crashvb/supervisord:202103212252
LABEL maintainer "Richard Davis <[email protected]>"
# Install packages, download files ...
RUN docker-apt libnss3-tools nut-server ssl-cert
# Configure: upsd
ENV NUT_CONFPATH=/etc/nut UPSD_NSS_PATH=/etc/nut/nss
ADD nut-* /usr/local/bin/
RUN usermod --append --groups ssl-cert nut && \
install --directory --group=root --mode=0775 --owner=root ${NUT_CONFPATH}/conf.d/ ${NUT_CONFPATH}/users.d/ /usr/local/share/nut && \
sed --expression="/^MODE=/s/none/netserver/" \
--in-place=.dist ${NUT_CONFPATH}/nut.conf && \
sed --expression="/^# you'll need to restart upsd/a LISTEN 0.0.0.0 3493" \
--expression="/^# CERTPATH \/usr/cCERTPATH ${UPSD_NSS_PATH}" \
--in-place=.dist ${NUT_CONFPATH}/upsd.conf && \
mv ${NUT_CONFPATH}/upsmon.conf ${NUT_CONFPATH}/upsmon.conf.dist && \
mv ${NUT_CONFPATH} /usr/local/share/nut/config
# Configure: supervisor
ADD supervisord.upsd.conf /etc/supervisor/conf.d/upsd.conf
# Configure: entrypoint
ADD entrypoint.upsd /etc/entrypoint.d/upsd
EXPOSE 3493/tcp
VOLUME ${NUT_CONFPATH}