#!/bin/bash
#
# Docker Entrypoint Script
# Runs startup indexing and starts FastAPI
#

set -e

echo "🦉 Crumbforest Starting..."
echo ""

# Run startup indexing (in background to not block startup)
echo "📚 Starting background indexing..."
python3 /app/startup_indexing.py &
INDEXING_PID=$!

# Start FastAPI
echo "🚀 Starting FastAPI..."
exec uvicorn main:app --host 0.0.0.0 --port 8000 --reload
