Shouvik599 commited on
Commit ·
6c174fd
1
Parent(s): f3db8b6
Added shell script
Browse files- Dockerfile +5 -4
- start.sh +13 -0
Dockerfile
CHANGED
|
@@ -11,8 +11,9 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 11 |
# Copy the application code
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
RUN
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
|
|
|
|
|
| 11 |
# Copy the application code
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
+
# Make the start script executable
|
| 15 |
+
RUN chmod +x start.sh
|
| 16 |
|
| 17 |
+
# HF Spaces requires port 7860
|
| 18 |
+
# We use the shell script as the entry point
|
| 19 |
+
CMD ["./start.sh"]
|
start.sh
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Check if the ChromaDB directory already exists
|
| 4 |
+
if [ ! -d "/code/chroma_db" ]; then
|
| 5 |
+
echo "📦 ChromaDB not found. Starting ingestion..."
|
| 6 |
+
python ingest.py
|
| 7 |
+
else
|
| 8 |
+
echo "✅ ChromaDB found. Skipping ingestion."
|
| 9 |
+
fi
|
| 10 |
+
|
| 11 |
+
# Start the FastAPI application
|
| 12 |
+
echo "🚀 Starting FastAPI server..."
|
| 13 |
+
uvicorn app:app --host 0.0.0.0 --port 7860
|