fix:修复bug

This commit is contained in:
Daniel
2026-04-07 18:01:32 +08:00
parent c29ff1a54b
commit 5ae8d50298
2 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
EDGE_DISPATCH_HOST=0.0.0.0
EDGE_DISPATCH_PORT=8060
EDGE_MAX_DISPATCH_RECORDS=2000
PYTHON_IMAGE=docker.m.daocloud.io/library/python:3.10-slim
APT_MIRROR=mirrors.aliyun.com
PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
PIP_TRUSTED_HOST=mirrors.aliyun.com
AUTO_PULL_LATEST=false
GIT_REPO_URL=
GIT_BRANCH=master
GIT_CLONE_DEPTH=1
GIT_PROJECT_SUBDIR=video_worker
OSS_ENABLED=true
OSS_ENDPOINT=https://oss-cn-shanghai.aliyuncs.com
OSS_BUCKET=aiclw
OSS_ACCESS_KEY_ID=LTAI5tPB3Mg5A3p2imzrFjBp
OSS_ACCESS_KEY_SECRET=vg917zL9EWSXvosVeiEcE6w4QT25bV
OSS_PUBLIC_BASE_URL=https://aicdn-video-worker.oss-cn-shanghai.aliyuncs.com
OSS_PREFIX=video-worker
LOG_LEVEL=INFO

View File

@@ -51,5 +51,30 @@ if [ "$AUTO_PULL" = "true" ] && [ -z "$GIT_REPO_URL_VAL" ]; then
fi
docker compose up -d --build
sleep 2
if ! docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
echo "[ERROR] container ${CONTAINER_NAME} is not running"
echo "[INFO] container status:"
docker ps -a --filter "name=^${CONTAINER_NAME}$" --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
echo "[INFO] recent logs:"
docker logs --tail 200 "${CONTAINER_NAME}" || true
exit 1
fi
if command -v curl >/dev/null 2>&1; then
HEALTH_OK=false
for _ in $(seq 1 30); do
if curl -fsS "http://127.0.0.1:${PORT}/health" >/dev/null 2>&1; then
HEALTH_OK=true
break
fi
sleep 1
done
if [ "$HEALTH_OK" = false ]; then
echo "[WARN] container is running but health endpoint is still not ready after 30s: http://127.0.0.1:${PORT}/health"
fi
fi
echo "[OK] center dispatch started"
echo "[INFO] health: curl http://127.0.0.1:${PORT}/health"