Browse Source

mqtt added to configuration

master
Dirk Alders 1 year ago
parent
commit
3d26f067de

+ 15
- 0
mqtt/Dockerfile View File

@@ -0,0 +1,15 @@
1
+FROM eclipse-mosquitto:2
2
+
3
+arg UID=1000
4
+arg GID=1000
5
+arg USER=unicorn
6
+
7
+RUN if [ ${USER} != "root" ]; then \
8
+        apk add shadow && \
9
+        groupadd -f -g ${GID} ${USER} && \
10
+        useradd -m -g ${USER} -u ${UID} ${USER}; \
11
+    fi
12
+
13
+RUN chown -R ${USER}:${USER} /mosquitto
14
+
15
+USER ${USER}

+ 10
- 0
mqtt/config_templates/open/mosquitto.conf View File

@@ -0,0 +1,10 @@
1
+listener 1883
2
+persistence true
3
+persistence_location /mosquitto/data/
4
+
5
+## Authentication ##
6
+allow_anonymous true
7
+
8
+## Logging - possibilities: error, warning, notice, information, all
9
+log_type warning
10
+

+ 12
- 0
mqtt/config_templates/protected/mosquitto.conf View File

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

+ 0
- 0
mqtt/config_templates/protected/passwd View File


+ 19
- 0
mqtt/docker-compose.template View File

@@ -0,0 +1,19 @@
1
+#version: '3'
2
+#services:
3
+
4
+  mqtt:
5
+    build: mqtt
6
+    volumes:
7
+      - type: bind
8
+        source: /home/dirk/tmp/mqtt/
9
+        target: /mosquitto/
10
+    ports:
11
+      - target: 1883
12
+        published: 1883
13
+        protocol: tcp
14
+        mode: host
15
+      - target: 9001
16
+        published: 9001
17
+        protocol: tcp
18
+        mode: host
19
+

Loading…
Cancel
Save