Files
tts/server/run.sh
dsyoon 7c226848cb Harden Apache SSL proxy and uvicorn запуск
Add HTTP->HTTPS redirect, SSL settings, and run uvicorn via Python module for compatibility.
2026-01-30 14:39:36 +09:00

18 lines
451 B
Bash

#!/usr/bin/env bash
set -euo pipefail
cd /home/dsyoon/workspace/tts
PORT="${PORT:-8019}"
if lsof -ti tcp:"${PORT}" >/dev/null 2>&1; then
echo "Stopping existing server on port ${PORT}..."
lsof -ti tcp:"${PORT}" | xargs -r kill -9
sleep 1
fi
python -m pip install -r requirements.txt
PORT="${PORT}" nohup python -m uvicorn server.main:app --host 0.0.0.0 --port "${PORT}" > server.log 2>&1 &
echo "Server started (PID: $!). Logs: server.log"