Files
it-tools-relay/docker-compose.yml
T
3970260761 a17ac893c2 fix: 注册接口 INSERT 列数不匹配导致注册失败(502);config.json 挂载修复容器重建后 DATA_DIR 漂移到易失层
- server.py: users 表经 ALTER 迁移为 9 列后注册仍按 4 列全量 VALUES 插入,
  SQLite 抛 OperationalError → nginx 502「注册失败」;改为显式列名插入,
  其余列走 DEFAULT(与 _ensure_admin 写法一致)
- docker-compose.yml: 挂载 ./data/config.json 到 DEFAULT_HOST_ROOT 容器路径,
  _load_storage_root() 才能读到 storage_root=/app/data;此前配置落在容器易失层,
  重建容器后 DATA_DIR 漂移到 /vol3/... 易失目录,用户库/密钥/上传全丢(历史用户登录失败)
2026-11-12 19:48:15 +08:00

37 lines
1.5 KiB
YAML
Raw Permalink 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
# 存储根配置必须持久:_load_storage_root() 读 DEFAULT_HOST_ROOT 容器路径下的 config.json,
# 不挂载则落在容器易失层,重建容器后 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