Spaces:
Build error
Build error
- Dockerfile +10 -7
Dockerfile
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
FROM python:3.
|
2 |
|
3 |
-
# Instalar dependencias requeridas
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ghostscript \
|
6 |
tesseract-ocr \
|
7 |
poppler-utils \
|
8 |
libxml2 \
|
9 |
-
unpaper \
|
10 |
nodejs \
|
11 |
npm \
|
12 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
@@ -14,24 +14,27 @@ RUN apt-get update && apt-get install -y \
|
|
14 |
# Verificar instalaci贸n de unpaper
|
15 |
RUN unpaper --version || (echo "Unpaper no se instal贸 correctamente" && exit 1)
|
16 |
|
17 |
-
#
|
18 |
WORKDIR /app
|
|
|
19 |
|
20 |
# Instalar dependencias de Python
|
21 |
COPY requirements.txt requirements.txt
|
22 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
|
24 |
# Configurar el frontend
|
25 |
-
COPY frontend/
|
26 |
WORKDIR /app/frontend
|
27 |
RUN npm install && npm run build
|
28 |
|
29 |
# Volver al directorio ra铆z de la app
|
30 |
WORKDIR /app
|
|
|
|
|
31 |
COPY . .
|
32 |
|
33 |
# Exponer el puerto
|
34 |
EXPOSE 7860
|
35 |
|
36 |
# Comando para iniciar la aplicaci贸n
|
37 |
-
CMD ["python", "app.py"]
|
|
|
1 |
+
FROM python:3.11-slim
|
2 |
|
3 |
+
# Instalar dependencias requeridas
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ghostscript \
|
6 |
tesseract-ocr \
|
7 |
poppler-utils \
|
8 |
libxml2 \
|
9 |
+
unpaper \
|
10 |
nodejs \
|
11 |
npm \
|
12 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
14 |
# Verificar instalaci贸n de unpaper
|
15 |
RUN unpaper --version || (echo "Unpaper no se instal贸 correctamente" && exit 1)
|
16 |
|
17 |
+
# Crear directorios
|
18 |
WORKDIR /app
|
19 |
+
RUN mkdir /app/frontend
|
20 |
|
21 |
# Instalar dependencias de Python
|
22 |
COPY requirements.txt requirements.txt
|
23 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
24 |
|
25 |
# Configurar el frontend
|
26 |
+
COPY frontend/ /app/frontend/
|
27 |
WORKDIR /app/frontend
|
28 |
RUN npm install && npm run build
|
29 |
|
30 |
# Volver al directorio ra铆z de la app
|
31 |
WORKDIR /app
|
32 |
+
|
33 |
+
# Copiar el resto de la aplicaci贸n
|
34 |
COPY . .
|
35 |
|
36 |
# Exponer el puerto
|
37 |
EXPOSE 7860
|
38 |
|
39 |
# Comando para iniciar la aplicaci贸n
|
40 |
+
CMD ["python", "app.py"]
|