EdoFede / 123Solar-meterN-Docker

A self-configuring Docker image to run 123Solar and meterN
GNU General Public License v3.0
3 stars 3 forks source link

Some Feed back #4

Closed halfagascan closed 1 year ago

halfagascan commented 4 years ago

cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

edofede/123solar-metern from docker hub

Seems to be running and logging data. I made some changes to the dockerfile, including adding the following: --log-opt max-size=50m \ -e TZ=America/Mexico_City \ The log-opt limits the amount of docker logs, I don't want to fill up the sdcard with logs. Without the -e TZ, the container time did not match the host time/date. I tried to change the location of the output, via the dockerfile, lots of errors, seems that the setup script is hard coded to what you have in the dockerfile.

I tried changing this: --volume 123solar_config:/var/www/123solar/config \ --volume 123solar_data:/var/www/123solar/data \ to: /home/pi/123solar_config:/var/www/123solar/config \ /home/pi/123solar_data:/var/www/123solar/data \ I would prefer to have the data located within the 123solar folder, not some volume, arbitrarily named with a volume number, is this possible? Thanks for taking the time to put this together.

EdoFede commented 4 years ago

Hi,

you are right on the timezone. I forgot to insert it in the guide.

To make it permanent, you can change the time zone in /etc/timezone file, logging in the container with docker exec -ti 123Solar-meterN bash as explained in this guide: https://wiki.alpinelinux.org/wiki/Setting_the_timezone Then restart the container.

Setting the TZ in the environment, as you done, is far more elegant :-)

Don't get worried about the log size. This container does not create any status logs, just error logs, so your sd card should not grow excessevely with logs.

The volumes used are not named with volume number, but are named volume with always the same name (and persistance, even if you delete the container). What you have done is a bind mount of a volume used on the host, which is not the right way and can lead to permission problems. Please take a look at: https://docs.docker.com/storage/bind-mounts/