19 lines
426 B
Bash
19 lines
426 B
Bash
|
|
#!/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
|