robot-u-site/scripts/run_prod.sh

19 lines
426 B
Bash
Raw Normal View History

2026-04-14 20:17:29 -04:00
#!/usr/bin/env bash
set -euo pipefail
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "${root_dir}"
host="${HOST:-0.0.0.0}"
port="${PORT:-8000}"
if [[ ! -f "${root_dir}/frontend/dist/index.html" ]]; then
echo "frontend/dist/index.html is missing. Build the frontend before starting production." >&2
exit 1
fi
exec python3 -m uvicorn app:app \
--host "${host}" \
--port "${port}" \
--proxy-headers