With the help of @davehun and @spikeheap from @northwalestech I have been working on an Emoncms Docker setup. Using Docker it’s possible to fire up Emoncms on a bare system (assuming Docker is installed) in a couple of minutes with all the LAMP config faff taken care of. This is great for development since you can play about with Emoncms running in a Docker container without fear of messing up your main Emoncms install.
In the future, Docker can even be used as a deployment tool for Emoncms. In theory, it should be possible to deploy the Docker container on any server within minutes
Please give it a try and let me know how you get on.
The next step will be to push an Emoncms Docker container to docker-hub to allow anyone interested in Emoncms to pull down the container and be up and running with Emoncms almost immediately.
Done: Docker Hub
To do:
Allow docker container to startup with a large amount of test data & demo dashboards etc.
Create ability to simulate a large number of inputs
Great to hear, how did you setup your Docker enviroment? I have gone for using two containers; one for php-apache and the other for mysql and linking them via docker-compose. I am keen to try and standardise on a docker setup which is best practice for emoncms in both development and production.
Very nice idea, because now I can let it run direct on my NAS
What do you think, is it possible to integrate an energy monitor via modbus also on docker?
Modbus integration is a separate topic to docker. Please start a new topic discussion. I have no experience of Modbus, there might be some Modbus discussion on the old forums. Maybe try and search Forums | Archived Forum
root@xen:/# docker ps | grep emon
438c4a303cb2 emoncms/apr "apache2-foreground" 4 months ago Up 3 weeks 0.0.0.0:80->80/tcp emoncms
82544e7154f8 redis:alpine "docker-entrypoint..." 4 months ago Up 3 weeks 6379/tcp emoncms_redis
ff511ce35222 mysql:5.6 "docker-entrypoint..." 4 months ago Up 3 weeks 3306/tcp emoncms_sql
root@xen:/#
I’ve been a very happy docker user for about a year. I managed to migrate from a basic emoncms install inside a VM to containers without losing anything.
I’ve learned a lot with @glyn.hudson post and as usual forgot to drop a simple thank you.
Very easy indeed! I get a login page of emoncms, but what is the default username and password? I found raspi-raspberry as combination on the web, but that doesn’t work on my system (Lubuntu).
I found it myself blush. I thought I couldn’t use register, because it would send an e-mail and that probably wouldn’t work. But it’s just used as an login name. But now I would like to use emonHUB and that doesn’t seem to be included in de docker image. I think I will go for a regular Ubuntu install, as docker is too new for me :-). And - as far as I understand - the docker image is (at the moment) only for development, not for real use.
I just tried to spin up a docker container using openenergymonitor/emoncms:latest but I am getting v10.1.13 when I login. From what I can tell, this image hasn’t been updated on Dockerhub for 2 years.
Is there a process to update this image after an EmonCMS release? Or do I just need to build it locally and use my own version of the image - i.e. is the version on Dockerhub obsolete and unused?