eberhenriquez94 commited on
Commit
9a5e881
verified
1 Parent(s): b81ef43
Files changed (1) hide show
  1. 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 ocrmypdf
5
  RUN apt-get update && apt-get install -y \
6
- tesseract-ocr \
7
  ghostscript \
8
- qpdf \
9
- libjpeg-dev \
10
- libpng-dev \
11
- libtiff-dev \
12
- libffi-dev \
13
- zlib1g-dev
 
14
 
15
- # Instalar las dependencias de Python
16
- COPY requirements.txt /app/requirements.txt
17
- RUN pip install --upgrade pip
18
- RUN pip install -r /app/requirements.txt
 
 
 
 
 
 
 
 
 
 
19
 
20
- # Copiar el c贸digo de la aplicaci贸n al contenedor
21
- COPY . /app
 
 
22
  WORKDIR /app
23
 
24
- # Comando para ejecutar la aplicaci贸n
 
 
 
 
 
 
 
 
 
 
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"]