From d909501b4a8b656bb120d023389bc0a6e4c71653 Mon Sep 17 00:00:00 2001 From: Kroonk Date: Thu, 21 May 2026 12:57:15 +0200 Subject: [PATCH] Add Calibre-Web infrastructure --- .env.example | 11 +++++++ .gitignore | 5 +++ Brain.md | 61 ++++++++++++++++++++++++++++++++++++ README.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 18 +++++++++++ 5 files changed, 172 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 Brain.md create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..fe82f5d --- /dev/null +++ b/.env.example @@ -0,0 +1,11 @@ +# Calibre-Web / books.mischlabs.de +TZ=Europe/Berlin +PUID=1000 +PGID=1000 + +# External NAS port. Reverse proxy points books.mischlabs.de to this port. +APP_PORT=8083 + +# Persistent NAS paths. Keep these as bind mounts; do not move book data into Git. +BOOKS_PATH=/volume1/calibreweb/data/books +CONFIG_PATH=/volume1/calibreweb/data/config diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f93d8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.env +*.log +tmp/ +cache/ + diff --git a/Brain.md b/Brain.md new file mode 100644 index 0000000..e6a9385 --- /dev/null +++ b/Brain.md @@ -0,0 +1,61 @@ +# Calibre-Web Brain + +Service: Calibre-Web / Books + +Domain: + +```text +https://books.mischlabs.de +``` + +Gitea target: + +```text +https://git.mischlabs.de/MrDiderot/CalibreWeb.git +``` + +Current NAS state captured on 2026-05-21: + +```text +Container: calibre-web +Image: lscr.io/linuxserver/calibre-web:latest +Ports: 0.0.0.0:8083->8083/tcp, :::8083->8083/tcp +Status: Up 4 days +``` + +Mounts: + +```text +/volume1/calibreweb/data/books -> /books +/volume1/calibreweb/data/config -> /config +``` + +Environment: + +```text +TZ=Europe/Berlin +PUID=1000 +PGID=1000 +``` + +Note: The live Compose file uses `PGID=${PGID:-10}`, but the inspected running container reported `PGID=1000`. This likely comes from the NAS `.env`. Preserve the NAS `.env` value when redeploying. + +Compose path on NAS: + +```text +/volume2/docker/calibreweb/docker-compose.yml +``` + +Decision: + +- This is currently an infrastructure repository, not a custom app image repository. +- Use the upstream image `lscr.io/linuxserver/calibre-web:latest`. +- The universal Watchtower instance on the NAS can update this service directly. +- Only add a Dockerfile and Gitea Actions workflow if custom image changes become necessary later. +- The initial `docker-compose.yml` in this repo was copied from the live NAS compose file at `/volume2/docker/calibreweb/docker-compose.yml`. + +Important: + +- Do not move or delete `/volume1/calibreweb/data/books`. +- Do not move or delete `/volume1/calibreweb/data/config`. +- If Calibre-Web appears empty after deployment, check bind mounts before assuming data loss. diff --git a/README.md b/README.md new file mode 100644 index 0000000..485f503 --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +# Calibre-Web / Books + +Infrastructure repository for the Calibre-Web service at: + +```text +https://books.mischlabs.de +``` + +The service currently uses the upstream LinuxServer image: + +```text +lscr.io/linuxserver/calibre-web:latest +``` + +No custom Docker image is required right now. Gitea stores the Compose setup and documentation; the universal Watchtower instance on the NAS updates the upstream image. + +## NAS Paths + +Current production paths: + +```text +Compose path: /volume2/docker/calibreweb/docker-compose.yml +Books: /volume1/calibreweb/data/books +Config: /volume1/calibreweb/data/config +``` + +The book library and Calibre-Web config stay on the NAS. They are mounted into the container and must not be committed to Git. + +## Current Container + +```text +Container: calibre-web +Image: lscr.io/linuxserver/calibre-web:latest +Port: 8083 -> 8083 +TZ: Europe/Berlin +PUID: 1000 +PGID: 1000 +``` + +## Deploy On NAS + +From the NAS: + +```sh +cd /volume2/docker/calibreweb +cp .env.example .env +nano .env +docker compose config +docker compose up -d +docker ps --filter "name=calibre-web" --format "table {{.Names}}\t{{.Image}}\t{{.Ports}}\t{{.Status}}" +``` + +## Watchtower + +The existing universal Watchtower service should remain responsible for updates. Do not create a second project-specific Watchtower unless explicitly requested. + +Manual one-time check: + +```sh +docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /volume2/docker/watchtower/config.json:/config.json:ro containrrr/watchtower --run-once +``` + +## Notes + +- A wrong `/books` mount can make the library look empty even when the files still exist. +- A wrong `/config` mount can make Calibre-Web start like a fresh install. +- Always verify mounts before recreating the container. + +## Source Of Truth + +The committed `docker-compose.yml` was copied from the live NAS compose file at: + +```text +/volume2/docker/calibreweb/docker-compose.yml +``` + +Only documentation and `.env.example` were added around it. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..826b6a4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + + calibre-web: + image: lscr.io/linuxserver/calibre-web:latest + container_name: calibre-web + restart: unless-stopped + + environment: + - PUID=${PUID:-1000} + - PGID=${PGID:-10} + - TZ=${TZ:-Europe/Berlin} + + volumes: + - ${BOOKS_PATH:-/volume1/calibreweb/data/books}:/books + - ${CONFIG_PATH:-/volume1/calibreweb/data/config}:/config + + ports: + - "${APP_PORT:-8083}:8083"