# SPDX-FileCopyrightText: 2026 Treader contributors # SPDX-License-Identifier: Apache-2.0 # TreaderOS 应用宿主:一个端口给设备和管理面板用,数据全在 ./data。 # 外网访问(Cloudflare 隧道)是宿主自带的,在面板“外网”页里开,不用另起容器。 # 可选(在 .env 的 COMPOSE_PROFILES 里打开): # tomato 番茄小说下载器(官方 Tomato-Novel-Downloader 镜像),给“番茄书库”应用用。 # TreaderOS app host: one port for devices and the panel, all data in ./data. Outside access (a Cloudflare tunnel) is # built in and switched on in the panel's 外网 tab; no extra container. Optional, enabled in COMPOSE_PROFILES in .env: # tomato the Tomato novel downloader (the official Tomato-Novel-Downloader image) for the Tomato app. services: host: # GitHub 自动构建的镜像;想在本机自己构建,把这一行换成 build: . / The image built by GitHub; to build locally, # replace this line with build: . image: ghcr.io/bidabrain/treaderos-host:latest container_name: treaderos-host restart: unless-stopped environment: ADMIN_PASSWORD: ${ADMIN_PASSWORD:?在 .env 里设置 ADMIN_PASSWORD / set ADMIN_PASSWORD in .env} # 宿主以这个用户运行;启动时会把 ./data 的属主自动改成它。/ The host runs as this user; ./data is handed to it # on start. PUID: ${PUID:-1000} PGID: ${PGID:-1000} PORT: 8090 TZ: ${TZ:-Asia/Shanghai} # 老的 .env 里填过 TUNNEL_TOKEN:第一次启动自动当作面板里的“我的隧道”。/ A TUNNEL_TOKEN from an old .env becomes # the panel's "my tunnel" on first start. TUNNEL_TOKEN: ${TUNNEL_TOKEN:-} ports: - "${HOST_PORT:-8090}:8090" volumes: - ./data:/data # 番茄下载器:只在 compose 内部网络里给宿主用,不对外开端口;“番茄书库”应用的设置里默认就填 # http://tomato-downloader:18423。容器名和 Treader 那套错开,两套可以同时开。 # The Tomato downloader: only for the host inside the compose network, no published port; the Tomato app's settings # default to http://tomato-downloader:18423. The container name differs from Treader's set, so both can run. tomato-downloader: # 官方镜像,固定版本号,验证过再升级(和 Treader 那套一样)。/ The official image, pinned; upgrade only after # checking (same as Treader's set). image: zhongbai233/tomato-novel-downloader-webui:${DOWNLOADER_VERSION:-v2.4.18-musl} container_name: treaderos-tomato profiles: ["tomato"] restart: unless-stopped # 书存在 /data/books(宿主机 data/tomato/books)。/ Books go to /data/books (data/tomato/books on the NAS). working_dir: /data/books command: ["--server", "--data-dir", "/data"] environment: TOMATO_WEB_ADDR: 0.0.0.0:18423 TZ: ${TZ:-Asia/Shanghai} volumes: - ./data/tomato:/data # 想直接打开下载器自己的网页,去掉下面两行的注释(它没有密码,只在局域网里开)。/ To open the downloader's own # web page, uncomment the next two lines (it has no password; keep it on the LAN). # ports: # - "18423:18423"