maxill1 / ialarm-mqtt

ialarm to mqtt bridge
MIT License
8 stars 3 forks source link

cannot run in docker #2

Closed andker87 closed 4 years ago

andker87 commented 4 years ago

once I launch the command to run via docker, this is the error I get

Found arg -c with value /config Found external config.json /config/ error loading config.json Error: Cannot find module '/config/config.json' Require stack:

maxill1 commented 4 years ago

Hi Andrea,

it seems like your container is binding the path "/config" to an empty folder or to a wrong path.

Please run the following command and check the "Binds" json property.

docker inspect ialarm-mqtt

(change ialarm-mqtt to the name of your container)

P.S. i just pushed a new image with some additional feature, like caching.

andker87 commented 4 years ago

still not working... I used as path my hassio config folder, as other dockers do, but I still get an error:

`root@raspberrypi:~# docker run --name ialarm-mqtt --restart always -v /usr/share/hassio/homeassistant:/config maxill1/ialarm-mqtt:latest Found arg -c with value /config Found external config.json /config/ error loading config.json Error: Cannot find module '/config/config.json' Require stack:

maxill1 commented 4 years ago

/usr/share/hassio/homeassistant contains the ialarm-mqtt config.json file?

Anyway to avoid confusion or data corruption you should not use directly the hassio config folder, make one on your host or at least you should use a subfolder of /usr/share/hassio/homeassistant.

for example, make the dir on your host:

mkdir /usr/share/hassio/homeassistant/ialarm cd /usr/share/hassio/homeassistant/ialarm

download the lastest config.json from master branch:

wget https://raw.githubusercontent.com/maxill1/ialarm-mqtt/master/config.json

edit your configuration (ip, username, mqtt, etc):

nano /usr/share/hassio/homeassistant/ialarm/config.json

and finally recreate the container:

docker run --name ialarm-mqtt --restart always -v /usr/share/hassio/homeassistant/ialarm:/config maxill1/ialarm-mqtt:latest

andker87 commented 4 years ago

Perfect, I managed to make it all work, apparently it was a directory permission issue, however I fixed it, thank you. I really like the project and I have a couple of ideas for improvement to share if possible. besides the pull request here on GitHub, is there a way to send you a direct message to ask you a couple of info about this project?

maxill1 commented 4 years ago

Any ideas or help will be appreciated. I don't think that GitHub has direct messages. You can find my email in the git logs ;) or i'm on twitter (i'm not active but has PM).

I just merged your PR and released 0.6.2 on npm and docker.