diff --git a/.gitignore b/.gitignore index 2eea525..2272aec 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.env \ No newline at end of file +.env +password.txt \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 88c6958..b217b7b 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,6 +1,17 @@ version: '3.5' services: + mosquitto: + image: eclipse-mosquitto + container_name: mosquitto + restart: always + ports: + - "1883:1883" + volumes: + - ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf + - ./mosquitto/password.txt:/mosquitto/config/password.txt + - ./mosquitto/acl.acl:/mosquitto/config/acl.acl + influxdb: image: influxdb:1.8.10 container_name: influxdb diff --git a/docker/mosquitto/acl.acl b/docker/mosquitto/acl.acl new file mode 100644 index 0000000..edb8897 --- /dev/null +++ b/docker/mosquitto/acl.acl @@ -0,0 +1,8 @@ +user admin +topic readwrite # + +user wuser +topic write data/# + +user ruser +topic read # \ No newline at end of file diff --git a/docker/mosquitto/mosquitto.conf b/docker/mosquitto/mosquitto.conf new file mode 100644 index 0000000..a58cd52 --- /dev/null +++ b/docker/mosquitto/mosquitto.conf @@ -0,0 +1,4 @@ +listener 1883 0.0.0.0 +allow_anonymous false +password_file /mosquitto/config/password.txt +acl_file /mosquitto/config/acl.acl \ No newline at end of file diff --git a/docker/mosquitto/password.txt.example b/docker/mosquitto/password.txt.example new file mode 100644 index 0000000..e69de29