Using Docker
Run FLibGoLite in Docker container
If you want to install FLibGoLite on a NAS based on open solutions such as openmediavault, Unraid, TrueNAS SCALE, Rockstor or commercial Synology, QNAP, etc., you can use a docker container
. A ready-made container
vinser/flibgolite:latest
can be downloaded from DockerHub. To run it, follow the documentation of your NAS. The parameters for running the container are given below in the docker_run.sh
script.
Alternatively, you can run FLibGoLite in a docker container
on your host (PC, server) with Windows, MacOS or Linux OS.
To do this, the host must have
Docker Desktop
or
Docker Engine
installed.
To start the container, you need to create three folders:
When starting the container, you must specify the paths to the created folders.
If necessary, you can specify the desired listening port number in the launch command -p 8085:8085
.
After that, you can run the command to launch the container.
To perform the listed actions and launch the container, you can use the script docker_run.sh
, which you can copy below
#!/usr/bin/env bash
# the script runs flibgolite docker container
# run this script from the root of the app folder
# put your books in the "books" folder
books_dir=$(pwd)/books
mkdir -p $books_dir
# here you can view logs
logs_dir=$(pwd)/logs
mkdir -p $logs_dir
# here is your books index database. Back up it if you want
dbdata_dir=$(pwd)/dbdata
mkdir -p $dbdata_dir
# run container and mount your folders
docker run -d \
--name=flibgolite \
-p 8085:8085 \
--mount type=bind,source=$books_dir,target=/flibgolite/books/stock \
--mount type=bind,source=$dbdata_dir,target=/flibgolite/dbdata \
--mount type=bind,source=$logs_dir,target=/flibgolite/logs \
vinser/flibgolite:latest
The script creates a books
folder in the current directory. Place your books in this folder and they will be included in the OPDS catalog. The logs and SQLite database will be in the logs
and dbdata
folders, respectively.
Tip
If you do not make backups of the SQLite database, then if problems occur due to power outages or a host shutdown, you need to do the following to restore the database: stop the container, clear the
dbdata
folder and start the container again. This will not take much time.
If you have any doubts about the safety of using a ready-made Docker container image, you can create it yourself directly on the host where Docker is installed. To do this, you need to clone the flibgolite repository
git clone https://github.com/vinser/flibgolite.git
then create an image using the command
docker build -f Dockerfile.selfbuild -t flibgolite .