aki-008 commited on
Commit
ad6937a
Β·
1 Parent(s): b40a2bc

fix: store chroma data in /tmp to avoid permission denied

Browse files
Files changed (1) hide show
  1. start.sh +6 -5
start.sh CHANGED
@@ -3,17 +3,19 @@ set -e
3
 
4
  # --- 1. Set Environment Variables ---
5
  export HOME=/home/user
6
- # Note: DATABASE_URL is automatically provided by Hugging Face Secrets (pointing to Render)
7
 
8
  # ChromaDB settings
9
  export chroma_host="127.0.0.1"
10
  export chroma_port="8080"
11
  export chroma_collection="prepai_collection"
12
 
13
- # --- 2. Start ChromaDB ---
14
  echo "🎨 Setting up ChromaDB..."
15
- mkdir -p ./chroma_store
16
- chroma run --host 0.0.0.0 --port 8080 --path ./chroma_store &
 
 
17
 
18
  # --- 3. Start Nginx (Non-root Mode) ---
19
  echo "🌐 Starting Nginx..."
@@ -57,5 +59,4 @@ nginx -c /tmp/nginx.conf &
57
  # --- 4. Start Backend ---
58
  echo "🐍 Starting Backend..."
59
  cd Backend
60
- # The app will connect to the Render DB using the DATABASE_URL secret
61
  python run.py
 
3
 
4
  # --- 1. Set Environment Variables ---
5
  export HOME=/home/user
6
+ # DATABASE_URL is provided by Hugging Face Secrets (Render)
7
 
8
  # ChromaDB settings
9
  export chroma_host="127.0.0.1"
10
  export chroma_port="8080"
11
  export chroma_collection="prepai_collection"
12
 
13
+ # --- 2. Start ChromaDB (Using /tmp for permissions) ---
14
  echo "🎨 Setting up ChromaDB..."
15
+ # FIX: Use /tmp because the app root is read-only for non-root users
16
+ export CHROMA_PATH="/tmp/chroma_store"
17
+ mkdir -p "$CHROMA_PATH"
18
+ chroma run --host 0.0.0.0 --port 8080 --path "$CHROMA_PATH" &
19
 
20
  # --- 3. Start Nginx (Non-root Mode) ---
21
  echo "🌐 Starting Nginx..."
 
59
  # --- 4. Start Backend ---
60
  echo "🐍 Starting Backend..."
61
  cd Backend
 
62
  python run.py