Spaces:
Sleeping
Sleeping
Commit
·
37fe659
1
Parent(s):
14fa828
Add Dockerfile and requirements for FastAPI RAG API
Browse files- .env +1 -0
- Dockerfile +6 -1
- render.yaml +1 -1
- requirements.txt +3 -1
.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GOOGLE_API_KEY=AIzaSyBOIxwYU-v9UBt87oXASKVU-zw_hsWfFW8
|
Dockerfile
CHANGED
|
@@ -1,16 +1,21 @@
|
|
| 1 |
-
FROM python:3.11
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && \
|
| 4 |
apt-get install -y tesseract-ocr libtesseract-dev poppler-utils && \
|
| 5 |
rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
WORKDIR /app
|
| 8 |
|
|
|
|
|
|
|
| 9 |
COPY requirements.txt .
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
|
|
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
ENV PORT=8000
|
|
|
|
| 15 |
|
| 16 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# Install system dependencies
|
| 4 |
RUN apt-get update && \
|
| 5 |
apt-get install -y tesseract-ocr libtesseract-dev poppler-utils && \
|
| 6 |
rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
|
| 11 |
+
# Install Python dependencies first (for layer caching)
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
+
# Copy application code
|
| 16 |
COPY . .
|
| 17 |
|
| 18 |
ENV PORT=8000
|
| 19 |
+
ENV PYTHONUNBUFFERED=1
|
| 20 |
|
| 21 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
render.yaml
CHANGED
|
@@ -7,5 +7,5 @@ services:
|
|
| 7 |
startCommand: uvicorn main:app --host 0.0.0.0 --port 8000
|
| 8 |
envVars:
|
| 9 |
- key: GOOGLE_API_KEY
|
| 10 |
-
|
| 11 |
plan: free
|
|
|
|
| 7 |
startCommand: uvicorn main:app --host 0.0.0.0 --port 8000
|
| 8 |
envVars:
|
| 9 |
- key: GOOGLE_API_KEY
|
| 10 |
+
valueFromEnv: GOOGLE_API_KEY
|
| 11 |
plan: free
|
requirements.txt
CHANGED
|
@@ -6,8 +6,10 @@ python-multipart
|
|
| 6 |
fastapi
|
| 7 |
uvicorn
|
| 8 |
google-generativeai
|
|
|
|
|
|
|
| 9 |
grpcio==1.74.0
|
| 10 |
grpcio-tools==1.74.0
|
| 11 |
grpcio-status==1.74.0
|
| 12 |
-
protobuf==5.
|
| 13 |
rpds.py==0.27.0
|
|
|
|
| 6 |
fastapi
|
| 7 |
uvicorn
|
| 8 |
google-generativeai
|
| 9 |
+
haystack-ai
|
| 10 |
+
haystack-integrations
|
| 11 |
grpcio==1.74.0
|
| 12 |
grpcio-tools==1.74.0
|
| 13 |
grpcio-status==1.74.0
|
| 14 |
+
protobuf==5.26.1
|
| 15 |
rpds.py==0.27.0
|