按 docs/v2/05-implementation-plan.md §1 候选迁移表与 claude_use/T00 白名单, 从 55e2cdb 抽取 224 个文件(2.48 MB)到独立目录 F:/mini-OpenClaw-v2。 - 排除:凭据(.env/server-deploy.conf/旧DELIVERY.md)、运行数据(xingbang_data 等 4 个 SQLite)、依赖(venv/node_modules 符号链接)、归档(_backup*/test-evidence/ ori_file)、Office 临时文件 - 目标目录独立 git 仓库,初始恢复点;Gitea 远程与分支待 OQ-06 Q2 定案 - 未部署、未启动服务、未调用模型 Co-Authored-By: Claude Code <noreply@anthropic.com>
36 lines
1.1 KiB
Bash
36 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
set -Eeuo pipefail
|
|
|
|
echo "Starting mini OpenClaw"
|
|
|
|
# An ERP connection is optional for the stable demo. If it is configured,
|
|
# wait for it before starting the application; otherwise start immediately.
|
|
if [[ -n "${ERP_DB_HOST:-}" ]]; then
|
|
if command -v pg_isready >/dev/null 2>&1; then
|
|
echo "Waiting for ERP database at ${ERP_DB_HOST}:${ERP_DB_PORT:-5432}..."
|
|
until pg_isready -h "${ERP_DB_HOST}" -p "${ERP_DB_PORT:-5432}" -U "${ERP_DB_USER:-}" >/dev/null 2>&1; do
|
|
sleep 2
|
|
done
|
|
echo "ERP database is ready"
|
|
else
|
|
echo "pg_isready is unavailable; skipping ERP readiness check"
|
|
fi
|
|
fi
|
|
|
|
echo "Starting backend on port 8002"
|
|
python /app/backend/app.py &
|
|
backend_pid=$!
|
|
|
|
echo "Starting frontend on port 3000"
|
|
cd /app/frontend
|
|
npm start -- -H 0.0.0.0 -p 3000 &
|
|
frontend_pid=$!
|
|
|
|
cleanup() {
|
|
kill "${frontend_pid}" "${backend_pid}" 2>/dev/null || true
|
|
}
|
|
trap cleanup TERM INT EXIT
|
|
|
|
# Stop the container if either service exits; Docker can then restart it.
|
|
wait -n "${backend_pid}" "${frontend_pid}"
|