File size: 1,851 Bytes
b75c637 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #!/usr/bin/env bash
# MOD-OSINT Docker entrypoint β startup self-check + Streamlit launch
set -euo pipefail
PORT="${STREAMLIT_PORT:-7860}"
HOST="${STREAMLIT_HOST:-0.0.0.0}"
if ! [[ "$PORT" =~ ^[0-9]+$ ]] || [ "$PORT" -lt 1 ] || [ "$PORT" -gt 65535 ]; then
echo "[fatal] Invalid STREAMLIT_PORT: ${PORT}" >&2
exit 1
fi
required_files=(
"gui/streamlit_app.py"
"engine/pipeline_orchestrator.py"
"requirements-hf.txt"
)
for file_path in "${required_files[@]}"; do
if [ ! -f "$file_path" ]; then
echo "[fatal] Missing required file: $file_path" >&2
exit 1
fi
done
for dir_path in runs logs; do
mkdir -p "$dir_path"
if [ ! -w "$dir_path" ]; then
echo "[fatal] Directory not writable: $dir_path" >&2
exit 1
fi
done
python3 - <<'PY'
import importlib
import sys
print(f"[startup] Python: {sys.version.split()[0]}")
for mod in ("streamlit", "pandas", "yaml"):
importlib.import_module(mod)
print("[startup] Dependency import check: OK")
PY
echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
echo " MOD-OSINT | Streamlit GUI"
echo " Binding: ${HOST}:${PORT}"
echo " Health URL: http://localhost:${PORT}/_stcore/health"
echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
if [ "${MODOSINT_STARTUP_CHECK_ONLY:-0}" = "1" ]; then
echo "[startup] MODOSINT_STARTUP_CHECK_ONLY=1 -> exiting after checks"
exit 0
fi
exec streamlit run gui/streamlit_app.py \
--server.address="${HOST}" \
--server.port="${PORT}" \
--server.enableCORS=false \
--server.enableXsrfProtection=false \
--server.headless=true \
--browser.gatherUsageStats=false
|