fix: 修复部署问题
This commit is contained in:
27
video_worker/center_dispatch/scripts/start.sh
Normal file
27
video_worker/center_dispatch/scripts/start.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
PROJECT_DIR="${ROOT_DIR}/center_dispatch"
|
||||
cd "$PROJECT_DIR"
|
||||
|
||||
if [ ! -f .env ]; then
|
||||
cp .env.example .env
|
||||
echo "[INFO] .env created from .env.example, please set GIT_REPO_URL/OSS config."
|
||||
fi
|
||||
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "[ERROR] docker not found"
|
||||
exit 1
|
||||
fi
|
||||
if ! docker compose version >/dev/null 2>&1; then
|
||||
echo "[ERROR] docker compose not available"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PORT=$(grep '^EDGE_DISPATCH_PORT=' .env | tail -n1 | cut -d'=' -f2- || true)
|
||||
PORT="${PORT:-8060}"
|
||||
|
||||
docker compose up -d --build
|
||||
echo "[OK] center dispatch started"
|
||||
echo "[INFO] health: curl http://127.0.0.1:${PORT}/health"
|
||||
Reference in New Issue
Block a user