From 56bf186922720a0de65866418f5ee1cdb9f65b67 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 14 Sep 2022 11:00:35 +0200 Subject: [PATCH] use supervisor --- Dockerfile | 8 ++++++-- supervisor-mosquitto.conf | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 supervisor-mosquitto.conf diff --git a/Dockerfile b/Dockerfile index 346aab4..1269f5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster +FROM debian:bullseye LABEL Maintainer="Wolfgang Hottgenroth " 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 diff --git a/supervisor-mosquitto.conf b/supervisor-mosquitto.conf new file mode 100644 index 0000000..7348967 --- /dev/null +++ b/supervisor-mosquitto.conf @@ -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