This commit is contained in:
parent
5a454e0b61
commit
d794a32247
@ -22,4 +22,26 @@ services:
|
|||||||
- 1883:1883
|
- 1883:1883
|
||||||
labels:
|
labels:
|
||||||
- com.centurylinklabs.watchtower.enable=true
|
- com.centurylinklabs.watchtower.enable=true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Mosquitto configuration file `/mosquitto/config/mosquitto.conf`:
|
||||||
|
```
|
||||||
|
listener 1883
|
||||||
|
|
||||||
|
persistence true
|
||||||
|
persistence_location /mosquitto/data/
|
||||||
|
|
||||||
|
log_dest file /mosquitto/log/mosquitto.log
|
||||||
|
log_dest stdout
|
||||||
|
log_type all
|
||||||
|
|
||||||
|
allow_anonymous false
|
||||||
|
password_file /mosquitto/config/passwd
|
||||||
|
```
|
||||||
|
|
||||||
|
Create empty file `/mosquitto/config/passwd`
|
||||||
|
And from the terminal create user sending:
|
||||||
|
```docker exec -it mqtt usr/bin/mosquitto_passwd -c /mosquitto/config/passwd USERNAME```
|
||||||
|
|
||||||
|
And if you want to add more users use:
|
||||||
|
```docker exec -it mqtt usr/bin/mosquitto_passwd -b /mosquitto/config/passwd NEW_USERNAME PASSWORD```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user