mqtt added to configuration

This commit is contained in:
Dirk Alders 2023-06-23 13:16:57 +02:00
parent 75ec7e5374
commit 3d26f067de
5 changed files with 56 additions and 0 deletions

15
mqtt/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM eclipse-mosquitto:2
arg UID=1000
arg GID=1000
arg USER=unicorn
RUN if [ ${USER} != "root" ]; then \
apk add shadow && \
groupadd -f -g ${GID} ${USER} && \
useradd -m -g ${USER} -u ${UID} ${USER}; \
fi
RUN chown -R ${USER}:${USER} /mosquitto
USER ${USER}

View File

@ -0,0 +1,10 @@
listener 1883
persistence true
persistence_location /mosquitto/data/
## Authentication ##
allow_anonymous true
## Logging - possibilities: error, warning, notice, information, all
log_type warning

View File

@ -0,0 +1,12 @@
listener 1883
persistence true
persistence_location /mosquitto/data/
## Authentication ##
# Create passwd file: mosquitto_passwd -c /mosquitto/config/passwd <user_name>
# You need to make down && make up to use the new passwd file
password_file /mosquitto/config/passwd
## Logging - possibilities: error, warning, notice, information, all
log_type warning

View File

View File

@ -0,0 +1,19 @@
#version: '3'
#services:
mqtt:
build: mqtt
volumes:
- type: bind
source: /home/dirk/tmp/mqtt/
target: /mosquitto/
ports:
- target: 1883
published: 1883
protocol: tcp
mode: host
- target: 9001
published: 9001
protocol: tcp
mode: host