Files
secondary-school-grade-archive/deploy/ocr-worker/start.sh
T

18 lines
385 B
Bash

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
VENV="${ROOT}/.venv"
HOST="${OCR_HOST:-0.0.0.0}"
PORT="${OCR_PORT:-23567}"
if [[ ! -d "${VENV}" ]]; then
echo "未找到虚拟环境,请先运行: bash install.sh"
exit 1
fi
# shellcheck disable=SC1091
source "${VENV}/bin/activate"
cd "${ROOT}"
exec uvicorn app:app --host "${HOST}" --port "${PORT}"