Spaces:
Running
Running
Commit Β·
3dc49f8
1
Parent(s): f8a3980
feat: support Hugging Face persistent storage at /data and local Docker volumes for persisting SQLite database (search logs/cache) across container rebuilds
Browse files
webapp/tipitaka-api/startup.sh
CHANGED
|
@@ -11,11 +11,17 @@ echo "β Downloading assets from HF bucket..."
|
|
| 11 |
cd /app/api
|
| 12 |
python download_assets.py
|
| 13 |
|
| 14 |
-
# ββ 2. Export paths for the API ββ
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
export
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
export SERVE_STATIC="true"
|
| 20 |
export STATIC_DIR="/app/web/dist"
|
| 21 |
|
|
|
|
| 11 |
cd /app/api
|
| 12 |
python download_assets.py
|
| 13 |
|
| 14 |
+
# ββ 2. Export paths for the API (Support HF Persistent Storage at /data) ββ
|
| 15 |
+
if [ -d "/data" ]; then
|
| 16 |
+
echo "β Persistent storage found at /data. Using it."
|
| 17 |
+
export DATA_DIR="/data"
|
| 18 |
+
else
|
| 19 |
+
export DATA_DIR="/app/data"
|
| 20 |
+
fi
|
| 21 |
+
|
| 22 |
+
export DATABASE_PATH="$DATA_DIR/tipitaka_mcu.db"
|
| 23 |
+
export QDRANT_PATH="$DATA_DIR/qdrant_storage"
|
| 24 |
+
export SNAPSHOT_DIR="$DATA_DIR/snapshots"
|
| 25 |
export SERVE_STATIC="true"
|
| 26 |
export STATIC_DIR="/app/web/dist"
|
| 27 |
|