hi there - I compiled some emoncms container that use local database . this way it can be used on more platforms architectures as the original emoncms-docker only works with amd64 ( as that what docker maridb container limited it too)
https://hub.docker.com/r/sash999/emoncms_localdb/tags
with amd64,arm64,mips64, arm7, arm6 and i386
if using on openwrt here a quick howto
download firmware for your device – Index of /releases/22.03.2/targets/
I use opensouce router base- BPI- R1, BPi-R2v1, BPI-R3 ( as they have build in SATA plus loads of other hardware) but can apply to many many other more simpler devices. you just may have to apply overlay first to get storage capacity
flash sd with openwrt - “startup disk creator”
resize partion with - “kde partition manager”
boot openwrt
opkg update
opkg install docker docker-compose dockerd luci-app-dockerman nano bash mosquitto-client-ssl mosquitto-ssl
mkdir /svr
mkdir /svr/mysql
opkg install mariadb-client mariadb-client-extra mariadb-server mariadb-server-extra openvpn-openssl luci-app-openvpn
nano /etc/config/mysqld
→ option enabled ‘1’
opkg update && opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb-storage kmod-usb2 kmod-usb3
reboot
log into webportal to setup overlay and/or openvpn port forwarding
add overlay disk if using one ( ie SSD or USB stick)
System> Mount Points > Mount points > add
openvpn port forwarding refer to this site
Howto - free/cheap VPN port forwarding for Starlink type systems (portmap.io) - Network and Wireless Configuration - OpenWrt Forum
backup - primary ( for faster system recovery in case of catastrophic failure)
now configure mariadb
mariadb -u root
you can use these or edit for your custom settings
CREATE DATABASE emoncms;
CREATE USER 'emoncms'@'localhost' IDENTIFIED BY 'qwerty0987';
GRANT ALL PRIVILEGES ON *.* TO 'emoncms'@'localhost';
FLUSH PRIVILEGES;
EXIT;
change openwrt webport from 80 to something else ie 88
nano /etc/config/uhttpd
reboot
select appropriate container for your device
arm/v6
docker pull sash999/emoncms_localdb:arm6
arm/v7
docker pull sash999/emoncms_localdb:arm7
i386
docker pull sash999/emoncms_localdb:386
mips64
docker pull sash999/emoncms_localdb:mips64
arm64
docker pull sash999/emoncms_localdb:arm64
amd64
docker pull sash999/emoncms_localdb:amd64
(if you need other let me know I will see if I can compile)
once finished downloading container
now log into webportal 192.168.1.1:88 ( new port address )
go to docker > container then press add
Name emoncms
image - sash999/emoncms_localdb
network - host-host
timezone- “what ever your timezone is”
save then then connect
if you wish custom setting emoncms setting once it started you can go to edit> console > connect then cd /var/www/emoncms then nano settings.ini
I See when using docker – localhost refers to within the docker container system. 127.0.0.1 refers to the host environment so choose carefully whether you use localhost or 127.0.0.1 it depends on what and where you have to communicate with
adjust as you like --I did not install redis container as I use a ssd overlay . if you wish to use redis
docker pull redis
and setup in docker
i will post git hub for it a little bit later as I clean it it up a bit