use supervisor

This commit is contained in:
Wolfgang Hottgenroth 2022-09-14 11:00:35 +02:00
parent 7e04777678
commit 56bf186922
2 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,4 @@
FROM debian:buster
FROM debian:bullseye
LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
LABEL ImageName="registry.hottis.de/dockerized/mosquitto-with-auth"
@ -10,7 +10,9 @@ ARG MOSQ_GID="1883"
RUN \
apt update && \
apt install -y mariadb-client openssl libwebsockets8 certbot && \
apt install -y mariadb-client openssl libwebsockets8 certbot bash cron supervisor vim-tiny && \
update-alternative --set editor /usr/bin/vim.tiny && \
update-alternative --set vi /usr/bin/vim.tiny && \
groupadd -r -g $MOSQ_GID $MOSQ_USER && \
useradd -m -r -u $MOSQ_UID -g $MOSQ_USER $MOSQ_USER && \
mkdir -p /opt/data
@ -18,9 +20,11 @@ RUN \
COPY opt/ /opt
COPY etc/ /opt/etc
COPY supervisor-mosquitto.conf /etc/supervisor/conf.d/
VOLUME /opt/etc
VOLUME /opt/data
EXPOSE 80/TCP
EXPOSE 443/TCP
EXPOSE 1883/tcp

10
supervisor-mosquitto.conf Normal file
View File

@ -0,0 +1,10 @@
[program:mosquitto]
environment=LD_LIBRARY_PATH="/opt/lib"
command=/opt/sbin/mosquitto -c /opt/etc/mosquitto/mosquitto.conf
autostart=true
autorestart=true
[program:certbot]
command=/usr/bin/certbot renew --standalone
autostart=false
autorestart=false