I converted to Docker on a NUC Ubuntu 16.04 from RPi 3.
I manage to get home assistant working with a few other problems but the main one is MQTT
It just wont start. and keeps restarting.
Here is my docker_compose.yaml file
version: '3'
services:
portainer:
container_name: portainer
image: portainer/portainer
volumes:
- /home/$USER/docker/portainer_data:/data
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "9000:9000"
mqtt:
image: eclipse-mosquitto:latest
container_name: "MQTT"
restart: always
volumes:
- /home/$USER/docker/mqtt/data:/mqtt/data
- /home/$USER/docker/mqtt/config:/mqtt/config
- /home/$USER/docker/mqtt/log:/mqtt/log
network_mode: "host"
ports:
- "1883:1883"
- "9001:9001"
All folders have been sudo chmod -R 777 /home/$USER/docker/mqtt/data
And this is the mosquitto.conf
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /home/cameron/docker/mqtt/data/
user homeassistant
# Port to use for the default listener.
port 1883
log_dest file /home/cameron/docker/mqtt/log/mosquitto.log
log_dest stdout
This is the sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bfd2ed266933 homeassistant/home-assistant "python -m homeassis…" 6 minutes ago Up 6 minutes 0.0.0.0:8123->8123/tcp, 0.0.0.0:51826->51826/tcp home-assistant
6536950e5b24 eclipse-mosquitto:latest "/docker-entrypoint.…" 6 minutes ago Restarting (3) 53 seconds ago
mqtt.yaml in Homeassistant…
broker: 127.0.0.1
port: 1883
discovery: true
client_id: home-assistant-nuc
keepalive: 60
username: !secret mqtt_user
password: !secret mqtt_password
Any help please…