TawfikDaim / home_automation

home automation user stories
0 stars 0 forks source link

docker-compose for mqtt #68

Open TawfikDaim opened 3 months ago

TawfikDaim commented 3 months ago

sudo docker-compose -p mqtt5_dockercompose up -d

sudo docker-compose -p mqtt5_dockercompose down

sudo docker-compose -p mqtt5_dockercompose logs

you need too change owner of any file e.g. sudo chmod 766 configuration.yaml

TawfikDaim commented 3 months ago

create a file in same directory /mqtt5/config/ mosquitto.conf allow_anonymous true listener 1883 listener 9001 protocol websockets

persistence true

password_file /mosquitto/config/pwfile

persistence_file mosquitto.db

persistence_location /mosquitto/data/

create folder in same directory: /mqtt5/config /mqtt5/data /mqtt5/log

docker-compose.yml version: "3.7" services:

mqtt5 eclipse-mosquitto

mqtt5_dockercompose: image: eclipse-mosquitto container_name: mqtt5_dockercompose ports:

volumes for mapping data,config and log

volumes: config: data: log:

networks:

default:

name: mqtt5-network