Spaces:
Sleeping
Sleeping
- Dockerfile +37 -16
Dockerfile
CHANGED
@@ -1,25 +1,46 @@
|
|
1 |
-
# Utilizamos una imagen base que tenga Python
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
-
# Instalar dependencias del sistema necesarias para
|
5 |
RUN apt-get update && apt-get install -y \
|
6 |
-
tesseract-ocr \
|
7 |
ghostscript \
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
14 |
|
15 |
-
#
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
-
#
|
21 |
-
|
|
|
|
|
22 |
WORKDIR /app
|
23 |
|
24 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
CMD ["python", "app.py"]
|
|
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
+
# Instalar dependencias del sistema necesarias para OCR y frontend
|
4 |
RUN apt-get update && apt-get install -y \
|
|
|
5 |
ghostscript \
|
6 |
+
tesseract-ocr \ # Instalar Tesseract OCR
|
7 |
+
poppler-utils \
|
8 |
+
libxml2 \
|
9 |
+
unpaper \
|
10 |
+
nodejs \
|
11 |
+
npm \
|
12 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
+
# Configurar el directorio de trabajo para el frontend
|
15 |
+
WORKDIR /app/frontend
|
16 |
+
|
17 |
+
# Copiar el archivo package.json y package-lock.json
|
18 |
+
COPY frontend/package.json frontend/package-lock.json* ./
|
19 |
+
|
20 |
+
# Limpiar cach茅 de npm para evitar problemas de versiones anteriores
|
21 |
+
RUN npm cache clean --force
|
22 |
+
|
23 |
+
# Instalar las dependencias de Node.js
|
24 |
+
RUN npm install
|
25 |
+
|
26 |
+
# Copiar el resto del c贸digo fuente
|
27 |
+
COPY frontend/ ./
|
28 |
|
29 |
+
# Construir el frontend
|
30 |
+
RUN npm run build
|
31 |
+
|
32 |
+
# Configurar el directorio de trabajo para el backend
|
33 |
WORKDIR /app
|
34 |
|
35 |
+
# Instalar las dependencias de Python
|
36 |
+
COPY requirements.txt .
|
37 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
38 |
+
|
39 |
+
# Copiar el c贸digo del backend
|
40 |
+
COPY . .
|
41 |
+
|
42 |
+
# Exponer el puerto para la aplicaci贸n
|
43 |
+
EXPOSE 7860
|
44 |
+
|
45 |
+
# Comando para iniciar la aplicaci贸n
|
46 |
CMD ["python", "app.py"]
|