Files
it-tools-relay/docker-compose.yml
T
3970260761 b30ffda52e fix: compose/README 补回 -v /:/hostfs(canonical run line 同款)+ config.json 持久挂载
6cae4e9 落盘 compose 时丢了 /:/hostfs:_load_storage_root 经 HOST_PREFIX 解析
storage_root,缺挂载则 DATA_DIR 漂移到容器易失 /vol3/... 层,重建容器后
用户库/.auth_secret/上传全丢(历史用户登录失败、新注册写易失层)。
同时挂载 config.json 双保险,并修正 storage_root=宿主真实数据路径
(容器路径 /app/data 在 hostfs 下会被前缀化到宿主无关目录)。
2026-11-12 20:04:17 +08:00

40 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
it-tools-relay:
image: 192.168.68.19:3200/jinghui/it-tools-relay:latest
container_name: it-tools-relay
restart: always
ports:
- "8091:8091"
env_file:
- .env
environment:
# 宿主数据目录(/hostfs、宿主路径访问类接口用)
- DEFAULT_HOST_ROOT=/vol3/1000/HD3/docker/it-tools-relay/data
# 容器出网走宿主 Mihomo 代理(BBC RSS 等境外源直连不可达,必须走代理)
- HTTPS_PROXY=http://host.docker.internal:7890
- HTTP_PROXY=http://host.docker.internal:7890
# 内网服务(NewAPI/OCR/授权中心)直连,不走代理
- NO_PROXY=localhost,127.0.0.1,192.168.68.19
volumes:
# 数据持久化:试用记录 / 用量库 / 用户库 / news.json
- ./data:/app/data
# 宿主全路径(canonical run line 同款):_load_storage_root 经 /hostfs 解析 config.json,
# 缺失则 DATA_DIR 漂移到容器易失 /vol3/... 层 → 重建容器后用户库/密钥全丢
- /:/hostfs
# 存储根配置必须持久:不挂载则落在容器易失层,重建容器后 storage_root 丢失
# → DATA_DIR 漂移到易失目录 → 用户库/密钥/上传全丢
- ./data/config.json:/vol3/1000/HD3/docker/it-tools-relay/data/config.json
cap_add:
- NET_ADMIN
extra_hosts:
# 代理/宿主服务访问依赖此解析(缺失会导致出网 Network unreachable)
- "host.docker.internal:host-gateway"
networks:
- ittools-net
networks:
# 必须接入既有 ittools-net,供 it-tools 的 nginx 按容器名反代;
# 已存在则必须 external=true,否则 compose 会重建同名网络导致孤立
ittools-net:
external: true