Using docker to install BrewPi


#62

Just got back into trying this again… docker via Container Station on a QNAP nas… with the currently latest docker pull.

If I start the docker container without the data volume mapping, the graphs, settings, and logs all work in the UI, but I lose all my settings and stuff, and any new settings are not stored externally to the container.
e.g.
docker run -d --name brewpi-nas --hostname brewpi-nas --network=“qnet-dhcp-bond0-6d6da6” --mac-address=“02:42:26:7A:88:C4” -e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -e TZ=America/Detroit --restart always brewpi/brewpi-ubuntu

If I start the docker container with the data volume mapping, the python code can’t seem to follow the symlinks from /home/brewpi/logs -> /data/logs for example… and the graphs, config settings, beer profiles, logs, etc… all fail to work in the UI. From a shell within the docker, all the logs and such are accessible (and current/updating). Seems like only SOME of the code can’t follow the symlinks anymore.

e.g.
$ docker run -d --name brewpi-nas --hostname brewpi-nas --network=“qnet-dhcp-bond0-6d6da6” --mac-address=“02:42:26:7A:88:C4” -e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -v /share/CACHEDEV1_DATA/brewpi-data:/data -e TZ=America/Detroit --restart always brewpi/brewpi-ubuntu

root@brewpi-nas:/home/brewpi# ls -al logs
lrwxrwxrwx 1 root root 10 Jan 8 22:59 logs -> /data/logs

root@brewpi-nas:/home/brewpi# ls -al /data/logs
total 28
drwxrwx—+ 2 1000 1000 4096 Dec 20 2017 .
drwxrwxrwx+ 10 1000 1000 4096 Nov 19 12:29 …
-rwxrwx—+ 1 1000 1000 70 Sep 14 2017 .gitignore
-rwxr-xr-x+ 1 1000 1000 826 Jan 8 22:59 stderr.txt
-rw-rwx—+ 1 1000 1000 2024 Jan 8 23:10 stdout.txt

root@brewpi-nas:/home/brewpi# ls -al /home/brewpi/logs/*
-rwxr-xr-x+ 1 1000 1000 826 Jan 8 22:59 /home/brewpi/logs/stderr.txt
-rw-rwx—+ 1 1000 1000 3128 Jan 8 23:16 /home/brewpi/logs/stdout.txt

root@brewpi-nas:/home/brewpi# cat /home/brewpi/logs/stderr.txt
Jan 08 2019 22:51:32 Fresh start! Log files erased.
Jan 08 2019 22:59:43 Notification: Script started for beer ‘fridge-constant’
Jan 08 2019 22:59:43 Connecting to controller…
Jan 08 2019 22:59:43 Background thread for serial started
Jan 08 2019 22:59:43 Serial (re)connected over WiFi at socket://192.168.4.244:6666
Jan 08 2019 22:59:43 Serial Error: socket disconnected)
Jan 08 2019 22:59:43 Error opening serial: Could not open port socket://192.168.4.244:6666: [Errno 111] Connection refused
Jan 08 2019 22:59:49 Error opening serial: Could not open port socket://192.168.4.244:6666: timed out
Jan 08 2019 22:59:50 Serial (re)connected over WiFi at socket://192.168.4.244:6666
Jan 08 2019 22:59:52 Found BrewPi v0.5.10 build 0.5.10-0-gac67918, running on a Particle Photon with a V2 shield