feat: 生产库克隆脚本 + 容器补 Node 运行时
Deploy VitePress site to Pages / build (push) Canceled after 0s
Deploy VitePress site to Pages / Deploy (push) Canceled after 0s

- tools/clone_database.py: 同服务器跨库克隆并建立独立应用账号的 provisioning 脚本。本机与服务器都没有 mysql 客户端,所以走 INSERT...SELECT 而非 dump/reload。刻意只读写命令行指定的两个 schema,且给应用单开账号而不是复用管理员
- Dockerfile: 补 nodejs。douyin/help.py 在模块导入阶段就执行 execjs.compile(libs/douyin.js),缺 JS 运行时会抛 RuntimeUnavailableError;而 main.py 要导入全部 7 个平台,于是整个应用连带环境自检一起挂掉

已在 192.168.20.220 上验证:7 个平台导入全部通过。
This commit is contained in:
2026-10-07 11:08:11 +08:00
parent bcc7361145
commit cffb407d15
2 changed files with 205 additions and 2 deletions
+5 -2
View File
@@ -26,7 +26,10 @@ ENV PYTHONUNBUFFERED=1 \
# at import time, and tools/utils.py reaches cv2 through slider_util, so without
# them the *application* fails to import, not just some image utility. tzdata is
# here because TZ=Asia/Shanghai is silently ignored without it, which would put
# every stored timestamp in UTC.
# every stored timestamp in UTC. nodejs is for PyExecJS: douyin/help.py compiles
# libs/douyin.js at *import* time, and because main.py imports every platform,
# that single platform being importable-or-not decides whether the whole app
# (and the environment self-check) comes up.
#
# The pip mirror is set for the same reason as the apt one: this host's route to
# the public index is slow.
@@ -41,7 +44,7 @@ RUN set -eux; \
apt-get install -y --no-install-recommends \
build-essential pkg-config default-libmysqlclient-dev \
libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 libxcb1 libgomp1 \
tzdata; \
tzdata nodejs; \
rm -rf /var/lib/apt/lists/*
WORKDIR /app