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.

Probably a daft questioin but then I am daft :wink:
I’m trying to install Emoncms in a docker container on an asutor nas.
I have docker installed on the nas ok.
So, here’s the daft bit. Do I need to install the Emoncms requirements (PHP, MySQL/MariaDB, Apache, Redis et al) on the NAS directly or in a docker container?

Following on from my question above. I started again fromm scratch following the instructions on this thread.
It seems to have gone ok but when I try to open it in a browser on another machine I get an Apache Error

Forbidden

You don’t have permission to access this resource.


Apache/2.4.38 (Debian) Server at

I have set up a Docker group. set access rights to rw.
Not sure what to try next.
Any pointers/ideas appreciated.
I attach a screenshot of portainer for info.

Can you get to the copyright file on this docker instance?, e.g. http://172.18.0.4/COPYRIGHT.txt

If that works fine, you need to have a look into the Apache logging.

1 Like

2 posts were split to a new topic: New hardware solution to replace Pi