mosquitto-with-auth/Dockerfile
Wolfgang Hottgenroth 3bf3b037f2 letsencrypt volume
2022-09-14 13:25:11 +02:00

43 lines
1.1 KiB
Docker

FROM debian:bullseye
LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
LABEL ImageName="registry.hottis.de/dockerized/mosquitto-with-auth"
LABEL AlternativeImageName="wollud1969/mosquitto-with-auth"
ARG MOSQ_USER="mosquitto"
ARG MOSQ_UID="1883"
ARG MOSQ_GID="1883"
RUN \
apt update && \
apt install -y mariadb-client openssl libwebsockets-dev certbot bash cron supervisor vim-tiny && \
update-alternatives --set editor /usr/bin/vim.tiny && \
update-alternatives --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
COPY opt/ /opt
COPY etc/ /opt/etc
COPY supervisor-mosquitto.conf /etc/supervisor/conf.d/
COPY crontab /etc/
COPY mosquitto.conf-sample /opt/etc/mosquitto/
COPY cert-deploy.sh /opt/sbin/
VOLUME /opt/etc
VOLUME /opt/data
VOLUME /var/log/supervisor
VOLUME /etc/letsencrypt
EXPOSE 80/TCP
EXPOSE 443/TCP
EXPOSE 1883/tcp
EXPOSE 8883/tcp
EXPOSE 9001/tcp
WORKDIR /opt
CMD /usr/bin/openssl dhparam -out /opt/etc/mosquitto/dh.pem 2048 && /usr/bin/supervisord -c /etc/supervisor/supervisord.conf