aki-008
commited on
Commit
Β·
ad6937a
1
Parent(s):
b40a2bc
fix: store chroma data in /tmp to avoid permission denied
Browse files
start.sh
CHANGED
|
@@ -3,17 +3,19 @@ set -e
|
|
| 3 |
|
| 4 |
# --- 1. Set Environment Variables ---
|
| 5 |
export HOME=/home/user
|
| 6 |
-
#
|
| 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 |
-
|
| 16 |
-
|
|
|
|
|
|
|
| 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
|