Files
2026-10-23 10:35:28 +08:00

25 lines
727 B
Bash
Executable File
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.
#!/usr/bin/env bash
# 在宿主机启动 tools 服务(LibreDesk 容器通过 host.docker.internal:4010 访问)。
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
if [ ! -f .env ]; then
echo "缺少 .env,请先执行 bash scripts/bootstrap.sh" >&2
exit 1
fi
# shellcheck disable=SC1091
set -a; . ./.env; set +a
cd services/tools
if [ ! -d node_modules ]; then
echo "==> 安装依赖(本服务零外部依赖,仅生成 lockfile)"
npm install --package-lock-only --silent >/dev/null 2>&1 || true
fi
echo "==> tools 服务启动于 :${TOOLS_PORT:-4010}"
echo " manifest: http://127.0.0.1:${TOOLS_PORT:-4010}/tools/manifest (需 X-Tools-Key)"
exec node src/server.js