diff --git a/Dockerfile b/Dockerfile index 53b5b64..6d50c92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,10 @@ ARG BASE_IMAGE=sutty/monit FROM ${BASE_IMAGE}:${ALPINE_VERSION} MAINTAINER "f " +RUN getent group 82 || addgroup -g 82 -S www-data +RUN adduser -s /bin/sh -G www-data -h /srv/matterbridge -D matterbridge RUN apk add --no-cache matterbridge daemonize + COPY ./monit.conf /etc/monit.d/matterbridge.conf COPY ./matterbridged.sh /usr/local/bin/matterbridged diff --git a/matterbridged.sh b/matterbridged.sh index 5b099c1..612769e 100755 --- a/matterbridged.sh +++ b/matterbridged.sh @@ -4,10 +4,11 @@ set -e pid=/run/matterbridge.pid log=/tmp/matterbridge.log cnf=/etc/matterbridge/matterbridge.toml +srv=/srv/matterbridge case $1 in start) - daemonize -a -e ${log} -o ${log} -p ${pid} -l ${pid} /usr/bin/matterbridge -conf ${cnf} + daemonize -a -e ${log} -o ${log} -p ${pid} -l ${pid} -u matterbridge -c ${srv} /usr/bin/matterbridge -conf ${cnf} ;; stop) test -f ${pid} || exit 0