GithubHelp home page GithubHelp logo

mp-se / fermentrack-docker Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 6.0 111 KB

An docker build process for the fermentrack projekt. See www.fermentrack.com for more information.

License: MIT License

Dockerfile 50.31% Shell 28.03% Python 21.66%

fermentrack-docker's Introduction

With the latest release of fermentrack the changes its not worth the effort to maintain this project anymore.

Fermentrack Docker Image

If you want to know more about Fermentrack please go to https://docs.fermentrack.com/.

This is the v2.x version of the image. Since fermentrack is moving to a full docker setup I have chosen to rewrite this and reuse as much as possible from the standard setup. The intention is to keep this as a "all-in-one" package as much as possible and include; django, nginx and redis in the same image. It will support either a sqlite database or a full postgres install just as the standard fermentrack (assume you have a postgres installation already). It will also be possible to run this on multiple devices in both priviliged and unprivliged mode for maximum compatibility.

if you have issues, please report them here; https://github.com/mp-se/fermentrack-docker/issues

Please note that the configuration options for v2.x is different from v1.x and not longer compatible so check the setup instructions. This is due to the internal file system structure of the base fermentrack install.

If you have an older version installed the DJANGO_SECRET_KEY can be found in the db directory in the file secretsetting.py

The following environment variables exist:

  • DJANGO_SECRET_KEY=django secret key
  • POSTGRES_HOST=ip or dns name (mandatory)
  • POSTGRES_PORT=5434 (optional, deafult value)
  • POSTGRES_DB=fermentrack (optional, default value)
  • POSTGRES_USER=fermentrack (optional, default value)
  • POSTGRES_PASSWORD=password (mandatory)

Volumes mount options (all are optional):

  • ./volumes/db:/app/db
  • ./volumes/data:/app/data
  • ./volumes/log:/app/log

Documentation

Documentation has now been moved to the docs folder of the repository, here you can find the history and instructions for build and installation.

Any suggestions on improvements are welcome. Pplease backup your data files before testing. I take no responsibility for lost data. The project is made available as is.

You can also read the documentation online at; https://fermentrack-docker.readthedocs.io/

Release history

v2.0.1 Migrated to using fermentrack docker base.

  • Fixed path to data directory so graphs are rendered correctly.

v2.0.0 Migrated to using fermentrack docker base.

  • Release bases on fermentrack built in docker support. Hopefully easier to maintain.
  • Combines the django, redis and nginx containers into one image.
  • Use sqlite database as default.
  • Will work on most platforms with minium configuration settings.

Troubleshooting

See Issues on github for known problems and options.

fermentrack-docker's People

Contributors

mp-se avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fermentrack-docker's Issues

question about volumes

Hi,

I've been porting this in to a home assistant addon, essentially allowing me to run fermentrack as an addon within my home automation system.

Home assistant addons have certain conventions to adhere to and one of them is that you get a set mount-point to persist data from your container.

In this instance we get a "/data" bind-mount in the docker container. As this isn't a volume I can't make a symlink to the locations you specify in "/home/fermentrack/fermentrack/db" etc.

I just wondered if it would be possible to have the following folders inside my "/data" folder instead.

So my plan would be to change the following:

/home/fermentrack/fermentrack/data >> /data/fermentrack/data
/home/fermentrack/fermentrack/db >> /data/fermentrack/db
/home/fermentrack/fermentrack/log >> /data/fermentrack/log

I'm not too hot on nginx or fermentracks architecture so I'm not sure how I can change these paths without changing fermentrack itself.

I guess changing the entire python env to /data/fermentrack isn't what I want as it means all the application files will be on the home automation server, but I do want the data, log and db directories.

If you are able to give me some guidance here is what I've got so far: https://github.com/mcinnes01/addon-fermentrack/

Many thanks

Andy

Process manager fails to start

The process manager that handles the brew-pi scripts fails to start with the following error message; Probably a miss when moving from cron to supervisor...

Traceback (most recent call last):
File "/home/fermentrack/fermentrack/utils/processmgr.py", line 15, in
from utils.processmgr_class import ProcessManager
ModuleNotFoundError: No module named 'utils'

Numpy

Hey,

getting an error message when trying to calibrate my iSpindel - The "numpy" python package is not available which is required for calibration.

I have tried install numpy for python and python 3 ( i have pip installed for both) "pip install numpy"

Any ideas?

Cheers

Matt

Disable option to update via git

Disable the update process in GIT, the easy way is probably to set the update preference to "do not update" and change the GUI so its clear for the user that the update needs to be done via a new docker image.

Rebuild based on latest fermentrack docker

Fermentrack has now been moved over to full docker so the plan is to redo the whole setup and align it with the current setup but still keep everything in one image. This would make maintenance easier and more aligned with future changes to fermentrack.

Would be good to have the option for an external postgres database but combine, django, ngnix and redis.

Error starting container, missing envkey DJANGO_SECRET_KEY

Creating fermentrack ... done
Attaching to fermentrack
fermentrack | Checking if all required volumes are mounted correctly
fermentrack | Volume for data and database are mounted.
fermentrack | Copying secret settings from db folder to image
fermentrack | Setting correct access rights on mounted volumes
fermentrack | Version of main linux packages installed in image:
fermentrack | ****************************************************************
fermentrack | Debian GNU/Linux 10 \n \l
fermentrack |
fermentrack | nginx version: nginx/1.14.2
fermentrack | Redis server v=5.0.3 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=94145a25ce04923
fermentrack | Python 3.7.3
fermentrack | Image build date:
fermentrack | Tue Apr 20 19:10:35 UTC 2021
fermentrack | Starting NGINX
fermentrack | Starting REDIS
fermentrack | nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
fermentrack | Checking if the container is running in priviliged mode
fermentrack | Failed to set capabilities on file /usr/bin/python3.7' (Operation not supported) fermentrack | The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file fermentrack | Failed to set capabilities on file /usr/bin/python3.7' (Operation not supported)
fermentrack | The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
fermentrack | Container is NOT running in priviligied mode (2)
fermentrack | Starting Fermentrack
fermentrack | Collecting static files
fermentrack | Traceback (most recent call last):
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/environ/environ.py", line 273, in get_value
fermentrack | value = self.ENVIRON[var]
fermentrack | File "/usr/lib/python3.7/os.py", line 678, in getitem
fermentrack | raise KeyError(key) from None
fermentrack | KeyError: 'DJANGO_SECRET_KEY'
fermentrack |
fermentrack | During handling of the above exception, another exception occurred:
fermentrack |
fermentrack | Traceback (most recent call last):
fermentrack | File "manage.py", line 25, in
fermentrack | execute_from_command_line(sys.argv)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
fermentrack | utility.execute()
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/management/init.py", line 395, in execute
fermentrack | self.fetch_command(subcommand).run_from_argv(self.argv)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/management/init.py", line 231, in fetch_command
fermentrack | settings.INSTALLED_APPS
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/conf/init.py", line 76, in getattr
fermentrack | self._setup(name)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/conf/init.py", line 63, in _setup
fermentrack | self._wrapped = Settings(settings_module)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/conf/init.py", line 142, in init
fermentrack | mod = importlib.import_module(self.SETTINGS_MODULE)
fermentrack | File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
fermentrack | return _bootstrap._gcd_import(name[level:], package, level)
fermentrack | File "", line 1006, in _gcd_import
fermentrack | File "", line 983, in _find_and_load
fermentrack | File "", line 967, in _find_and_load_unlocked
fermentrack | File "", line 677, in _load_unlocked
fermentrack | File "", line 728, in exec_module
fermentrack | File "", line 219, in _call_with_frames_removed
fermentrack | File "/home/fermentrack/fermentrack/fermentrack_django/settings.py", line 26, in
fermentrack | SECRET_KEY = env("DJANGO_SECRET_KEY")
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/environ/environ.py", line 123, in call
fermentrack | return self.get_value(var, cast=cast, default=default, parse_default=parse_default)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/environ/environ.py", line 277, in get_value
fermentrack | raise ImproperlyConfigured(error_msg)
fermentrack | django.core.exceptions.ImproperlyConfigured: Set the DJANGO_SECRET_KEY environment variable
fermentrack | Applying database migration
fermentrack | Traceback (most recent call last):
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/environ/environ.py", line 273, in get_value
fermentrack | value = self.ENVIRON[var]
fermentrack | File "/usr/lib/python3.7/os.py", line 678, in getitem
fermentrack | raise KeyError(key) from None
fermentrack | KeyError: 'DJANGO_SECRET_KEY'
fermentrack |
fermentrack | During handling of the above exception, another exception occurred:
fermentrack |
fermentrack | Traceback (most recent call last):
fermentrack | File "manage.py", line 25, in
fermentrack | execute_from_command_line(sys.argv)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
fermentrack | utility.execute()
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/management/init.py", line 395, in execute
fermentrack | self.fetch_command(subcommand).run_from_argv(self.argv)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/management/base.py", line 328, in run_from_argv
fermentrack | self.execute(*args, **cmd_options)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/management/base.py", line 366, in execute
fermentrack | self.check()
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/management/base.py", line 395, in check
fermentrack | include_deployment_checks=include_deployment_checks,
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/management/commands/migrate.py", line 63, in _run_checks
fermentrack | issues = run_checks(tags=[Tags.database])
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/checks/registry.py", line 72, in run_checks
fermentrack | new_errors = check(app_configs=app_configs)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/core/checks/database.py", line 9, in check_database_backends
fermentrack | for conn in connections.all():
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/db/utils.py", line 222, in all
fermentrack | return [self[alias] for alias in self]
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/db/utils.py", line 219, in iter
fermentrack | return iter(self.databases)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/utils/functional.py", line 48, in get
fermentrack | res = instance.dict[self.name] = self.func(instance)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/db/utils.py", line 153, in databases
fermentrack | self._databases = settings.DATABASES
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/conf/init.py", line 76, in getattr
fermentrack | self._setup(name)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/conf/init.py", line 63, in _setup
fermentrack | self._wrapped = Settings(settings_module)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/django/conf/init.py", line 142, in init
fermentrack | mod = importlib.import_module(self.SETTINGS_MODULE)
fermentrack | File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
fermentrack | return _bootstrap._gcd_import(name[level:], package, level)
fermentrack | File "", line 1006, in _gcd_import
fermentrack | File "", line 983, in _find_and_load
fermentrack | File "", line 967, in _find_and_load_unlocked
fermentrack | File "", line 677, in _load_unlocked
fermentrack | File "", line 728, in exec_module
fermentrack | File "", line 219, in _call_with_frames_removed
fermentrack | File "/home/fermentrack/fermentrack/fermentrack_django/settings.py", line 26, in
fermentrack | SECRET_KEY = env("DJANGO_SECRET_KEY")
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/environ/environ.py", line 123, in call
fermentrack | return self.get_value(var, cast=cast, default=default, parse_default=parse_default)
fermentrack | File "/home/fermentrack/venv/lib/python3.7/site-packages/environ/environ.py", line 277, in get_value
fermentrack | raise ImproperlyConfigured(error_msg)
fermentrack | django.core.exceptions.ImproperlyConfigured: Set the DJANGO_SECRET_KEY environment variable
fermentrack | Version/Source of fermentrack installed in image:
fermentrack | ****************************************************************
fermentrack | origin https://github.com/thorrak/fermentrack.git (fetch)
fermentrack | origin https://github.com/thorrak/fermentrack.git (push)
fermentrack |
fermentrack | commit 02391da4b303e1b1b53745a4cc56fa4e08934632
fermentrack | Author: Thorrak [email protected]
fermentrack |
fermentrack | Finalize changelog for release
fermentrack | ****************************************************************
fermentrack | Starting circus deamon

Latest update breaks script/LCD

Latest update (April 5th) seems to break the script that updates LCD. Debug connection works and returns results... however; getting error in main fermentrack status "Cannot receiveLCD text fromController/Script".

Rollback to previous container/gitcommit works. Wiped everything and while i'm able to communicate to brewpi in diag the main communication script seems to be broken.

Can't see Tilt

I'm running the container on a R.Pi3 with a fresh install of DietPi ARMv7 via:

docker run -d --name fermentrack --privileged --network host -v /home/goose/fermentrack/db:/home/fermentrack/fermentrack/db -v /home/goose/fermentrack/data:/home/fermentrack/fermentrack/data -v /home/goose/fermentrack/log:/home/fermentrack/fermentrack/log -v /dev:/dev mpse2/fermentrack-docker:latest

Setup goes fine, I select to not use GitHub updates. I'm able to add my controller without difficulty; however, my Tilt does not read. It's working, I'm about to see it via the Tilt mobile app. My bluetooth dongle works, scans fine outside of Docker.

Any ideas?

Permission error on virtual env

The fermentrack user has no write access to the virtual environment causing pyhton updates to fail. Solution is to change ownership of the directory.

Synology NAS error

When i try to run your image on my Synology NAS, I am getting an error that says "Volume for data and / or database is NOT mounted. Aborting startup ..." Any help would be greatly appreciated!

Backup function not working

In the april release there is a nee feature for doing backups, this does not work on this docker build, probalbly due to access rights

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.