Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- Dockerfile +28 -0
- requirements.txt +14 -0
Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Instalar tesseract en el sistema
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
tesseract-ocr \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Instalar dependencias para OpenCV
|
| 11 |
+
RUN apt-get update && apt-get install -y \
|
| 12 |
+
libgl1 \
|
| 13 |
+
libglib2.0-0 \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# Copiar e instalar las dependencias de Python
|
| 17 |
+
COPY requirements.txt .
|
| 18 |
+
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 19 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
+
|
| 21 |
+
# Copiar el código del proyecto
|
| 22 |
+
COPY . .
|
| 23 |
+
|
| 24 |
+
# Exponer el puerto que usa Hugging Face Spaces
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# Comando para arrancar la aplicación con Uvicorn
|
| 28 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
requirements.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi==0.111.0
|
| 2 |
+
uvicorn==0.30.1
|
| 3 |
+
python-multipart==0.0.9
|
| 4 |
+
opencv-python-headless==4.9.0.80
|
| 5 |
+
numpy==1.26.4
|
| 6 |
+
paddleocr==2.7.3
|
| 7 |
+
paddlepaddle==2.6.1
|
| 8 |
+
pytesseract==0.3.10
|
| 9 |
+
ultralytics==8.2.0
|
| 10 |
+
google-genai==0.3.0
|
| 11 |
+
huggingface_hub==0.23.0
|
| 12 |
+
transformers==4.41.0
|
| 13 |
+
requests==2.31.0
|
| 14 |
+
torch==2.4.0
|