No description
  • Java 87.4%
  • Dockerfile 12.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Proud 9ffb5542a9
Merge pull request #7 from binarymelon/task/3-upstream-sync-required-bf195784
add v130 migration, skip for sqlite as default is already accounted f…

Fixes #3
2026-03-11 13:22:22 -03:00
.github/workflows Add workflow to detect upstream migration/entity/repository changes 2026-03-09 22:12:31 -03:00
gradle/wrapper Initial commit: multi-database wrapper for Booklore 2026-03-08 20:56:43 -03:00
src fix column length based on adjusted baseline 2026-03-11 13:03:03 -03:00
upstream@bf1957847c add v130 migration, skip for sqlite as default is already accounted for in code and would require costly table recreation 2026-03-11 13:01:09 -03:00
.dockerignore Initial commit: multi-database wrapper for Booklore 2026-03-08 20:56:43 -03:00
.gitignore add v130 migration, skip for sqlite as default is already accounted for in code and would require costly table recreation 2026-03-11 13:01:09 -03:00
.gitmodules Initial commit: multi-database wrapper for Booklore 2026-03-08 20:56:43 -03:00
build.gradle Fix SQLite concurrency: WAL mode, busy_timeout, and connection handling 2026-03-09 19:52:48 -03:00
CLAUDE.md Add CLAUDE.md with project context, architecture, and maintenance plan 2026-03-09 08:43:29 -03:00
Dockerfile Initial commit: multi-database wrapper for Booklore 2026-03-08 20:56:43 -03:00
gradlew Initial commit: multi-database wrapper for Booklore 2026-03-08 20:56:43 -03:00
gradlew.bat Initial commit: multi-database wrapper for Booklore 2026-03-08 20:56:43 -03:00
LICENSE Create LICENSE 2026-03-09 21:12:07 -03:00
README.md Add README with multi-DB overview and quick-start examples 2026-03-09 20:48:01 -03:00
settings.gradle Initial commit: multi-database wrapper for Booklore 2026-03-08 20:56:43 -03:00

BookLore Multi-DB

An unofficial wrapper around BookLore that adds SQLite and PostgreSQL support. The upstream project supports MariaDB only. This image is a drop-in replacement that accepts the same environment variables and volumes, with the addition that the DATABASE_URL environment variable will accept JDBC urls for SQLite and PostgreSQL as well.

All BookLore features, configuration options, and documentation apply unchanged. See the official docs for the full reference.


Supported databases

Database DATABASE_URL format
SQLite jdbc:sqlite:/path/to/booklore.db
PostgreSQL jdbc:postgresql://host:5432/booklore
MariaDB jdbc:mariadb://host:3306/booklore

Warning

Please don't use this project with MariaDB. Whlie it should work in theory, I likely won't test it and it's an unnecessary complication with no benefit.


Quick start

SQLite (simplest setup, no separate database required)

docker run -d \
  --name booklore \
  -p 6060:6060 \
  -v /path/to/data:/app/data \
  -v /path/to/books:/books \
  -v /path/to/bookdrop:/bookdrop \
  -e USER_ID=1000 \
  -e GROUP_ID=1000 \
  -e TZ=Etc/UTC \
  -e DATABASE_URL=jdbc:sqlite:/app/data/db/booklore.db \
  binarymelon/booklore-multidb:latest

The database file is created automatically on first run inside /app/data/db/, which is already mapped to your host via the /app/data volume.

PostgreSQL

# docker-compose.yml
services:
  booklore:
    image: binarymelon/booklore-multidb:latest
    container_name: booklore
    environment:
      - USER_ID=1000
      - GROUP_ID=1000
      - TZ=Etc/UTC
      - DATABASE_URL=jdbc:postgresql://postgres:5432/booklore
      - DATABASE_USERNAME=booklore
      - DATABASE_PASSWORD=your_secure_password
    depends_on:
      postgres:
        condition: service_healthy
    ports:
      - "6060:6060"
    volumes:
      - ./data:/app/data
      - ./books:/books
      - ./bookdrop:/bookdrop
    healthcheck:
      test: wget -q -O - http://localhost:6060/api/v1/healthcheck
      interval: 60s
      retries: 5
      start_period: 60s
      timeout: 10s
    restart: unless-stopped

  postgres:
    image: postgres:17
    container_name: postgres
    environment:
      - POSTGRES_DB=booklore
      - POSTGRES_USER=booklore
      - POSTGRES_PASSWORD=your_secure_password
    volumes:
      - ./pgdata:/var/lib/postgresql/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U booklore"]
      interval: 5s
      timeout: 5s
      retries: 10
docker compose up -d

Configuration

All upstream environment variables are supported. Key ones:

Variable Default Description
DATABASE_URL — JDBC URL selecting the database backend (required)
DATABASE_USERNAME — Database username (not needed for SQLite)
DATABASE_PASSWORD — Database password (not needed for SQLite)
USER_ID / GROUP_ID 1000 UID/GID the process runs as
TZ Etc/UTC Container timezone
BOOKLORE_PORT 6060 HTTP port
DISK_TYPE LOCAL Set to NETWORK to disable file writes when using NAS/NFS storage

For OIDC, Kobo sync, remote auth, Swagger, and all other options see the official BookLore documentation.


SQLite notes

  • The database file is created automatically; no setup required.
  • SQLite is a single-writer database. Concurrent library scans are handled safely via WAL journal mode and connection handling tuned for this workload, but very large libraries with many simultaneous users may be better served by PostgreSQL.
  • Requires SQLite 3.31+ (2020-01-22) for generated column support.

Source