-
Notifications
You must be signed in to change notification settings - Fork 2
Deployment using Docker
In this part of the docs, you will learn how to build and deploy BeeLogger using Docker! No surprise that you want to have docker and docker-compose installed... :)
To just start right away, just use our image hosted on docker hub. Continue at "Setting it up".
If there is no image released yet, or you want to change something about BeeLogger that isn't configurable, you may build the image yourself.
- If you haven't done already, clone the BeeLogger repository.
- cd into the cloned folder
- Make your changes to the "example_config.py" file or leave it blank if you want to use environment variables (the file will automatically be copied to the container by Docker).
- use the following command to build the image:
docker build --tag beelogger .
(include the dot!) - grab some coffee as this may take a long time!
"hanging" pip wheel builds are likely not errors! Wait at least 5 minutes! Pip will keep you up to date if the build is still running. e.g.:
This took around 10 minutes. - Ignore pip warnings about running it as root...everything is fine.
If you see this, you are done!
Successfully built *****
Successfully tagged beelogger:latest
telegram_bot_token=
insert_token=
display_token=
correction={"0": 1}
tare={"0": 0}
real_tare={"0": 0}
mysql_host=db
mysql_port=3306
mysql_user=root
mysql_pass=
mysql_db=beelogger
pages={}
mysql_backup_host=
mysql_backup_port=3306
mysql_backup_user=
mysql_backup_pass=
mysql_backup_db=
backup_host=
backup_port=
backup_user=
backup_pass=
backup_key=
backup_dir=
mail_host=
mail_port=
mail_user=
mail_pass=
mail_rec=
The Docker-compose deployment may be set up very easily and is thus recommended.
- Create a folder for the instance; e.g. "/home/beelogger/beelogger-docker"
- cd into that folder
- create the "docker-compose.yml" file
- paste the following:
docker-compose.yml:
############################ DON'T CHANGE ANYTHING IN HERE - USE THE .env FILE! ############################
version: '3.1'
services:
db:
image: mariadb:10.3
restart: always
ports:
- 3306
volumes:
- "./docker_volumes/mariadb:/var/lib/mysql"
environment:
MYSQL_ROOT_PASSWORD: "${mysql_pass}"
beelogger:
image: ghcr.io/programmier-ag/beelogger:latest
# Uncomment if you'd like to build the image yourself.
# build: .
depends_on:
- db
restart: "no"
ports:
- 2688:8000
volumes:
- "./docker_volumes/contact:/app/contact"
- "./docker_volumes/backup:/app/backup"
- "./docker_volumes/logs:/app/logs"
- "./docker_volumes/secrets:/app/secrets"
env_file: .env
Use the following command to start the container. Change the options to your liking...
Run command
docker run -d \
--restart "unless-stopped" \
-v "/var/beelogger/contact:/app/contact" \
-v "/var/beelogger/backup:/app/backup" \
-v "/var/beelogger/logs:/app/logs" \
-v "/var/beelogger/secrets:/app/secrets" \
-p "2688:8000" \
--env-file "./.env" \
beelogger
Use docker-compose up -d
to create and start the containers
BeeLogger should be available under port 2688.
Done 😃
BeeLogger-rewrite © Programmier-AG 2020-2022 Do not redistribute
All rights reserved