#!/bin/sh set -eu mkdir -p /app/data/fulltext ( attempts="${CCRD_INDEX_BUCKET_ATTEMPTS:-6}" delay="${CCRD_INDEX_BUCKET_RETRY_SECONDS:-5}" attempt=1 while ! python /app/prepare_fulltext_index.py; do if [ -z "${CCRD_INDEX_BUCKET_DIR:-}" ] || [ "$attempt" -ge "$attempts" ]; then python /app/build_fulltext_db.py exit fi sleep "$delay" attempt=$((attempt + 1)) done ) & exec uvicorn app:app --host 0.0.0.0 --port 7860 --log-level info