I just installed emoncms in docker (because redis/ubuntu etc) but I notice that the UI around the HeatPump app was a little different (no instantaneous COP for example). I see that the bottom of the page announces
which makes me wonder if the docker image is a little stale?
Is there a way to get a more up to date one anywhere? Or to update one? On the whole, the docker solution is looking good for me, especially now I’ve tweaked it to bind mount rather than hide everything away in volumes. Makes backup/restore much more straightforward.
I managed to build a local container from the git sources, probably about the same time @alexandrecuer but I had no means to push it public (or confidence that it would work for anyone else).
I tried swapping this image in today (I need the post-processor module) and it’s not working. I have a working setup and simply edited the top of my docker-compose.yml file
When I bring it up, there’s no database connectivity. I can jump into the db with mysql from the host running the docker containers and I can see that both root and emoncms users specify host ‘%’ in the mysql.users table, which was my first thought. Clearly I can connect from 127.0.0.1 (as root or emoncms).
db-1 | 2024-12-06 15:15:44 4 [Warning] Access denied for user 'root'@'172.18.0.4' (using password: NO)
web-1 | 2024-12-06 15:15:44 3 [Warning] Access denied for user 'emoncms'@'localhost' (using password: YES)
web-1 | [Fri Dec 06 15:15:44.744076 2024] [php:error] [pid 155:tid 155] [client 192.168.246.104:53340] PHP Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'emoncms'@'localhost' (using password: YES) in /var/www/emoncms/index.php:74\nStack trace:\n#0 /var/www/emoncms/index.php(74): mysqli->__construct()\n#1 {main}\n thrown in /var/www/emoncms/index.php on line 74
My docker compose file remains otherwise unchanged:
It is not a one to one replacement. Architectures and design decisions are different. alexjunk/emoncms is a multi services container, it ships everything on board, ie mariadb, redis, the mqtt broker and the workers like feedwriter or service runner
The container waits for a data folder with an emoncms folder inside structured like that :
As I do not use the openenergymonitor/emoncms image, I cannot test anything from my side. I would say it would be easier to backup the datas as an emoncms backup and then to restore into a container in the alexjunk/emoncms using the backup module.
So I would rather add a new service called emoncms in the compose using the alexjunk/emoncms, create an account, restore the tar.gz…see this : https://emoncms-docker.github.io/setup/
Thanks for the quick reply. I hadn’t realised that it was all-in-one. However, I think I can work with what you suggest. I’ll try it later. As I already have an mqtt broker on my network, can I use that instead? Is that configurable by environment variable?
Secondly, as this is not drop-in compatible, it perhaps ought to be noted as such in the wiki documentation @glyn.hudson as any user will need a radically different docker compose file?
I have it working and now that I see what you’ve done I like it very much - better than the official docker compose/images. Much simpler and cleaner, but I guess that’s why you did it…
I’ve installed emoncms many times in this adventure, but this was by far the easiest and quickest.
I didn’t have a “backup.tar.gz” but I got a shell inside the docker and mysql < dump.sql to restore, and once I worked out what the file owner needed to be, I copied the phpfina files into the right place and it just works.
Great that you found it be easy. This was the goal
I was using the scripted install before and always add problems with the logs filling up when going to production monitoring quite large industrial grade installations with pumps an 3 way valves to manage.
Now i do everything with that image and it works like a charm in one or two clicks
I can’t emphasise enough how simple this install of emoncms is - it would be worth considering as the recommended way unless you’re on dedicated hardware like a pi and needing the hub.
It should work on raspberry pi. I now use more jetson devices but i have 2 monitoring setups on raspberry pi3 and they run this image. One runs also emonhub on it as a separate container