Zigbee2mqtt: Docker test image based on Gladys v4

OK, I understand :sweat_smile:

When you set these two options:

  • -v /var/lib/z2m-test:/var/lib/gladysassistant
  • SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-zigbee2mqtt.db

You mount your host folder /var/lib/z2m-test into the container as /var/lib/gladysassistant
Then you tell Gladys to work with /var/lib/gladysassistant, which it does when it creates the Mosquito and Z2M configuration files. That’s why you find the configuration files in /var/lib/z2m-test on your host.

When Gladys creates the other containers (Mosquito and Z2M), it uses the SQLITE_FILE_PATH variable to mount the volumes. So the /var/lib/gladysassistant of your host… That’s where it doesn’t work. I don’t know how to detect that /var/lib/gladysassistant is actually a mount of /var/lib/z2m-test.

I suggest you try with this docker-compose file :thinking:

docker run -d \
    --log-opt max-size=10m \
    --restart=always \
    --privileged \
    --network=host \
    --name GladysZigbee2mqtt \
    -e NODE_ENV=production \
    -e SERVER_PORT=1080 \
    -e TZ=Europe/Paris \
    -e SQLITE_FILE_PATH=/var/lib/z2m-test/gladys-zigbee2mqtt.db \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /var/lib/z2m-test:/var/lib/z2m-test \
    -v /dev:/dev \
    -v /run/udev:/run/udev:ro \
    cicoub13/gladys:dev-zigbee2mqtt