eberhenriquez94 commited on
Commit
ae6949f
verified
1 Parent(s): 7182873
Files changed (1) hide show
  1. Dockerfile +16 -19
Dockerfile CHANGED
@@ -1,6 +1,6 @@
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 \
@@ -11,30 +11,27 @@ RUN apt-get update && apt-get install -y \
11
  npm \
12
  && apt-get clean && rm -rf /var/lib/apt/lists/*
13
 
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"]
 
1
+ FROM python:3.9-slim
2
 
3
+ # Instalar dependencias del sistema necesarias para ocrmypdf y frontend
4
  RUN apt-get update && apt-get install -y \
5
  ghostscript \
6
  tesseract-ocr \
 
11
  npm \
12
  && apt-get clean && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Configuraci贸n del directorio de trabajo para el frontend
15
+ WORKDIR /app/frontend
16
+
17
+ # Copiar el frontend y sus dependencias
18
+ COPY frontend/package.json frontend/package-lock.json ./
19
+ RUN npm install
20
+ COPY frontend/ .
21
+ RUN npm run build
22
 
23
+ # Configuraci贸n del directorio de trabajo para la aplicaci贸n backend
24
  WORKDIR /app
 
25
 
26
  # Instalar dependencias de Python
27
+ COPY requirements.txt .
28
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
29
 
30
+ # Copiar el c贸digo del backend
31
  COPY . .
32
 
33
+ # Exponer el puerto de la aplicaci贸n
34
  EXPOSE 7860
35
 
36
  # Comando para iniciar la aplicaci贸n
37
+ CMD ["python", "app.py"]