Files
reader/docker-compose.yml
T
cnb.dQC5J6ohAGA ca68a03e5d merge: 解决 auto/init-server-scaffold-81b3 与 main 的冲突
两个分支各自演进:一侧引入格式注册表、H5 客户端与 Android 外壳,另一侧
引入漫画目录书与逐页取图。冲突集中在扫描器、metadata、library 路由和 web
客户端,逐项按「两边能力都要保留」的原则合并。

合并后修复了 4 个被冲突掩盖的真实缺陷:

- scanner 同时保留了两套目录书实现,类型检查与测试均无法通过;改为统一
  走格式注册表,目录书在文件遍历之前发现,其内容不再重复入库。
- /manifest 的 files 对漫画目录书返回的是文件夹路径,客户端无法逐页取图;
  改为由 manifest 派生真实页路径。
- 单个文件端点只认 book_files 行,漫画目录书的每一页都 404;改为目录书
  额外认领其目录下的路径,并修正路径归一化使穿越尝试仍被拒绝。
- 目录书判定只看图片数量,会把夹着一本书的目录整体吞掉;改为注册表驱动
  的判定,含书籍文件的目录始终是书架。

同时修复了 web 端两套测试运行器互相无法执行对方用例的问题(vitest 与
node:test 混跑会静默跳过),以及 web 侧 5 处类型错误。

Ref: #9
2026-09-16 18:04:11 +08:00

53 lines
2.2 KiB
YAML

# One command to get running:
#
# docker compose up -d
#
# Then open http://<your-host>:8080 and register the first account, which
# automatically becomes the instance admin.
services:
reader:
image: cnb.cool/hectorqin/reader:latest
# To build from source instead of pulling the published image. The context is
# the repository root because the image bakes in the H5 client built from
# ./web as well as the server.
# build:
# context: .
# dockerfile: server/Dockerfile
container_name: reader
restart: unless-stopped
ports:
- "8080:8080"
environment:
# Polling intervals in seconds. Set to 0 to disable (a manual scan is
# still available from the admin API).
SCAN_INTERVAL: "1800"
WATCH_INTERVAL: "60"
LOG_LEVEL: "info"
# Set this to the address you actually reach the server on, so download
# links work behind a reverse proxy.
# PUBLIC_URL: "https://reader.example.com"
# Uncomment to allow family members to self-register instead of the admin
# creating their accounts:
# ALLOW_REGISTRATION: "true"
# Origins allowed to call the API from a browser, comma separated.
# Empty (the default) reflects whatever origin asks. Fine for a LAN: the
# client does not know the address it will be reached on, and there are no
# cookies in the design. Set it if the instance is on the public internet:
# CORS_ORIGINS: "https://reader.example.com"
# Directory holding the built H5 client, served at `/`. Already set in the
# image; only override if you build the client separately.
# WEB_DIR: "/app/web"
volumes:
# --- your books, mounted READ-ONLY ---
# The server NEVER writes to this directory. Replace the left-hand side
# with the path to your own library.
- /path/to/your/books:/books:ro
# --- everything the server writes lives here ---
# SQLite database, cover cache, scan journal.
- ./data:/data
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:8080/api/v1/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
interval: 30s
timeout: 5s
retries: 3