32 lines
823 B
Bash
Executable File
32 lines
823 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# PDF zu ICS Web-MVP starten (Linux/macOS)
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
PYTHON_CMD=""
|
|
if command -v python3 &> /dev/null; then
|
|
PYTHON_CMD="python3"
|
|
elif command -v python &> /dev/null; then
|
|
PYTHON_CMD="python"
|
|
else
|
|
echo "❌ Fehler: Python nicht gefunden!"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d ".venv" ]; then
|
|
echo "📦 Python-Umgebung wird eingerichtet..."
|
|
$PYTHON_CMD -m venv .venv --upgrade-deps || exit 1
|
|
fi
|
|
|
|
PYTHON_VENV=".venv/bin/python"
|
|
|
|
if ! $PYTHON_VENV -c "import fastapi" 2>/dev/null; then
|
|
echo "📚 Installiere Web-Abhängigkeiten..."
|
|
$PYTHON_VENV -m pip install -q -r web/requirements-web.txt || exit 1
|
|
fi
|
|
|
|
echo "🌐 Starte Web-App auf http://0.0.0.0:8000"
|
|
exec $PYTHON_VENV -m uvicorn web.app:app --host 0.0.0.0 --port 8000
|