Spaces:
Sleeping
Sleeping
Vineetiitg commited on
Commit ·
a0010e2
1
Parent(s): ead06f2
chore: add Docker setup and dependency pins
Browse files- Dockerfile.backend +18 -0
- Dockerfile.frontend +11 -0
- docker-compose.yml +48 -0
- requirements.txt +21 -0
Dockerfile.backend
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
RUN apt-get update && apt-get install -y gcc g++ \
|
| 6 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
+
|
| 11 |
+
COPY ./app /app/app
|
| 12 |
+
|
| 13 |
+
RUN python -c "from langchain_community.embeddings import FastEmbedEmbeddings; FastEmbedEmbeddings(model_name='BAAI/bge-small-en-v1.5')"
|
| 14 |
+
RUN python -c "from langchain_community.cross_encoders import HuggingFaceCrossEncoder; HuggingFaceCrossEncoder(model_name='BAAI/bge-reranker-base')"
|
| 15 |
+
|
| 16 |
+
EXPOSE 8000
|
| 17 |
+
|
| 18 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
Dockerfile.frontend
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
RUN pip install --no-cache-dir streamlit requests
|
| 6 |
+
|
| 7 |
+
COPY ./ui /app/ui
|
| 8 |
+
|
| 9 |
+
EXPOSE 8501
|
| 10 |
+
|
| 11 |
+
CMD ["streamlit", "run", "ui/app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
docker-compose.yml
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version: '3.8'
|
| 2 |
+
|
| 3 |
+
services:
|
| 4 |
+
qdrant:
|
| 5 |
+
image: qdrant/qdrant:latest
|
| 6 |
+
ports:
|
| 7 |
+
- "6333:6333"
|
| 8 |
+
volumes:
|
| 9 |
+
- qdrant_storage:/qdrant/storage
|
| 10 |
+
restart: always
|
| 11 |
+
|
| 12 |
+
ollama:
|
| 13 |
+
image: ollama/ollama:latest
|
| 14 |
+
ports:
|
| 15 |
+
- "11434:11434"
|
| 16 |
+
volumes:
|
| 17 |
+
- ollama_storage:/root/.ollama
|
| 18 |
+
restart: always
|
| 19 |
+
|
| 20 |
+
backend:
|
| 21 |
+
build:
|
| 22 |
+
context: .
|
| 23 |
+
dockerfile: Dockerfile.backend
|
| 24 |
+
ports:
|
| 25 |
+
- "8000:8000"
|
| 26 |
+
environment:
|
| 27 |
+
- QDRANT_URL=http://qdrant:6333
|
| 28 |
+
- OLLAMA_BASE_URL=http://ollama:11434
|
| 29 |
+
depends_on:
|
| 30 |
+
- qdrant
|
| 31 |
+
- ollama
|
| 32 |
+
restart: always
|
| 33 |
+
|
| 34 |
+
frontend:
|
| 35 |
+
build:
|
| 36 |
+
context: .
|
| 37 |
+
dockerfile: Dockerfile.frontend
|
| 38 |
+
ports:
|
| 39 |
+
- "8501:8501"
|
| 40 |
+
environment:
|
| 41 |
+
- BACKEND_URL=http://backend:8000/chat/stream
|
| 42 |
+
depends_on:
|
| 43 |
+
- backend
|
| 44 |
+
restart: always
|
| 45 |
+
|
| 46 |
+
volumes:
|
| 47 |
+
qdrant_storage:
|
| 48 |
+
ollama_storage:
|
requirements.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi==0.110.0
|
| 2 |
+
uvicorn==0.27.1
|
| 3 |
+
pydantic-settings==2.2.1
|
| 4 |
+
langchain==0.2.17
|
| 5 |
+
langchain-community==0.2.19
|
| 6 |
+
langchain-core==0.2.43
|
| 7 |
+
langchain-text-splitters==0.2.4
|
| 8 |
+
langchain-ollama==0.1.3
|
| 9 |
+
langchain-qdrant==0.1.4
|
| 10 |
+
qdrant-client==1.10.1
|
| 11 |
+
fastembed==0.3.6
|
| 12 |
+
sentence-transformers==2.5.1
|
| 13 |
+
langgraph==0.2.76
|
| 14 |
+
guardrails-ai==0.5.0
|
| 15 |
+
ragas==0.1.21
|
| 16 |
+
datasets==2.18.0
|
| 17 |
+
pandas==2.2.1
|
| 18 |
+
jinja2==3.1.3
|
| 19 |
+
tabulate==0.9.0
|
| 20 |
+
streamlit==1.32.2
|
| 21 |
+
requests==2.34.2
|