Spaces:
Running
Running
Commit ·
2735311
1
Parent(s): 05a9f57
Fix: Compatible langchain versions + better startup script
Browse files- Dockerfile +4 -7
- requirements.txt +7 -7
- startup.sh +17 -2
Dockerfile
CHANGED
|
@@ -25,12 +25,9 @@ RUN mkdir -p /app/workspace_data /app/chroma_db
|
|
| 25 |
# Expose ports
|
| 26 |
EXPOSE 8000 8501
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
sleep 5\n\
|
| 32 |
-
streamlit run streamlit_app.py --server.port=8501 --server.address=0.0.0.0 --server.headless=true\n\
|
| 33 |
-
' > /app/start.sh && chmod +x /app/start.sh
|
| 34 |
|
| 35 |
# Run both services
|
| 36 |
-
CMD ["/bin/bash", "/app/
|
|
|
|
| 25 |
# Expose ports
|
| 26 |
EXPOSE 8000 8501
|
| 27 |
|
| 28 |
+
# Copy startup script
|
| 29 |
+
COPY startup.sh /app/startup.sh
|
| 30 |
+
RUN chmod +x /app/startup.sh
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# Run both services
|
| 33 |
+
CMD ["/bin/bash", "/app/startup.sh"]
|
requirements.txt
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
# =============================================
|
| 2 |
-
# LIGHTWEIGHT REQUIREMENTS FOR AZURE APP SERVICE
|
| 3 |
# =============================================
|
| 4 |
|
| 5 |
-
# Core LangChain (
|
| 6 |
-
langchain==0.
|
| 7 |
-
langchain-core==0.
|
| 8 |
-
langchain-community==0.
|
| 9 |
-
langgraph==0.
|
| 10 |
|
| 11 |
# Groq LLM
|
| 12 |
-
langchain-groq==0.1.
|
| 13 |
|
| 14 |
# Web API
|
| 15 |
fastapi==0.110.0
|
|
|
|
| 1 |
# =============================================
|
| 2 |
+
# LIGHTWEIGHT REQUIREMENTS FOR AZURE APP SERVICE
|
| 3 |
# =============================================
|
| 4 |
|
| 5 |
+
# Core LangChain (compatible versions)
|
| 6 |
+
langchain==0.2.14
|
| 7 |
+
langchain-core==0.2.32
|
| 8 |
+
langchain-community==0.2.12
|
| 9 |
+
langgraph==0.2.0
|
| 10 |
|
| 11 |
# Groq LLM
|
| 12 |
+
langchain-groq==0.1.9
|
| 13 |
|
| 14 |
# Web API
|
| 15 |
fastapi==0.110.0
|
startup.sh
CHANGED
|
@@ -1,7 +1,22 @@
|
|
| 1 |
#!/bin/bash
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
uvicorn app.api:app --host 0.0.0.0 --port 8000 &
|
|
|
|
| 5 |
|
| 6 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
streamlit run streamlit_app.py --server.port 8501 --server.address 0.0.0.0 --server.headless true
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
+
set -e
|
| 3 |
|
| 4 |
+
echo "Starting FastAPI backend on port 8000..."
|
| 5 |
uvicorn app.api:app --host 0.0.0.0 --port 8000 &
|
| 6 |
+
BACKEND_PID=$!
|
| 7 |
|
| 8 |
+
# Wait for backend to be ready
|
| 9 |
+
echo "Waiting for backend to start..."
|
| 10 |
+
sleep 10
|
| 11 |
+
|
| 12 |
+
# Check if backend is running
|
| 13 |
+
if ! kill -0 $BACKEND_PID 2>/dev/null; then
|
| 14 |
+
echo "ERROR: Backend failed to start"
|
| 15 |
+
exit 1
|
| 16 |
+
fi
|
| 17 |
+
|
| 18 |
+
echo "Backend started successfully (PID: $BACKEND_PID)"
|
| 19 |
+
echo "Starting Streamlit frontend on port 8501..."
|
| 20 |
+
|
| 21 |
+
# Start Streamlit frontend (this will keep the container running)
|
| 22 |
streamlit run streamlit_app.py --server.port 8501 --server.address 0.0.0.0 --server.headless true
|