mosquitto-with-auth/Dockerfile
Wolfgang Hottgenroth 35541e6fdc documentation
2022-09-14 14:19:01 +02:00

44 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 procps net-tools && \
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/bin/
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/supervisord", "-c", "/etc/supervisor/supervisord.conf" ]