Shouvik599 commited on
Commit
6c174fd
·
1 Parent(s): f3db8b6

Added shell script

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -4
  2. 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
- # Run the data ingestion script
15
- RUN python ingest.py
16
 
17
- # Run the application in Hugging Face Space
18
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
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