Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Emoncms Docker...run Emoncms on your machine in 4 commands!

Hi Ben,

Looks like Docker development never really took off. More info at the link below:

According to that post, the build-script should be usable as the basis of a Docker image.

Thanks @Bill.Thomson - I will try building my own image using the Dockerfile in the emoncms-docker repo and see how I get on.

This has been working well for me for about 18 months, I rebuild it pretty often.

I don’t use very many features so the rather enthusiastic rm -rf might get rid of things you care about.

FROM openenergymonitor/emoncms

RUN rm -rf /var/www/emoncms

RUN mkdir /var/www/emoncms

RUN git clone https://github.com/emoncms/emoncms.git /var/www/emoncms

WORKDIR /var/www/emoncms/Modules

RUN git clone https://github.com/emoncms/dashboard.git
RUN git clone https://github.com/emoncms/graph.git
RUN git clone https://github.com/emoncms/app.git
RUN git clone https://github.com/emoncms/device.git

RUN chmod -R a+rx .

WORKDIR /var/www/emoncms/

COPY settings.ini .

Thanks for sharing. Any reason you don’t use the Dockerfile from the emoncms-docker repo? I guess if it ain’t broke…

I had to fix a typo on the device repo clone command, but other than that it has worked OK so far.

Good stuff @ben.jones12 - keep using the one from the repo if it’s doing what you need. It sounds like you are rocking now.

I use the stripped down one because I develop an app and wanted less things around to think about.

Just as an FYI - Please note that the systemd people are pretty strongly anti-Docker, because of Docker’s anti-systemd stance. So potentially expect difficult problems if you try to do anything complicated. Suppposedly Podman https://podman.io/ is a close to identical replacement. I don’t know much more than that; I haven’t used either.

I’ve got an odd issue, how do I backup my data? The build in Backup option doesn’t appear to show, even though the Component appears to be loaded:

image

I’ve been using this Docker build for a couple of years, want to migrate to a new VM and wanted to rebuild using the current recommended method.