dhammawatthumpra commited on
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
Files changed (1) hide show
  1. webapp/tipitaka-api/startup.sh +11 -5
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
- export DATA_DIR="/app/data"
16
- export DATABASE_PATH="/app/data/tipitaka_mcu.db"
17
- export QDRANT_PATH="/app/data/qdrant_storage"
18
- export SNAPSHOT_DIR="/app/data/snapshots"
 
 
 
 
 
 
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