Spaces:
Build error
Build error
- Dockerfile +10 -8
Dockerfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
-
# Instalar dependencias del sistema necesarias para
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
ghostscript \
|
6 |
tesseract-ocr \
|
@@ -11,25 +11,27 @@ RUN apt-get update && apt-get install -y \
|
|
11 |
npm \
|
12 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
-
#
|
15 |
WORKDIR /app/frontend
|
16 |
-
|
|
|
|
|
17 |
RUN npm install
|
18 |
-
COPY frontend/
|
19 |
-
RUN npm run build
|
20 |
|
21 |
-
#
|
22 |
WORKDIR /app
|
23 |
|
24 |
# Instalar dependencias de Python
|
25 |
COPY requirements.txt .
|
26 |
RUN pip install --no-cache-dir -r requirements.txt
|
27 |
|
28 |
-
# Copiar el c贸digo
|
29 |
COPY . .
|
30 |
|
31 |
# Exponer el puerto de la aplicaci贸n
|
32 |
EXPOSE 7860
|
33 |
|
34 |
# Comando para iniciar la aplicaci贸n
|
35 |
-
CMD ["python", "
|
|
|
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 \
|
|
|
11 |
npm \
|
12 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
+
# Configurar directorio de trabajo para el frontend
|
15 |
WORKDIR /app/frontend
|
16 |
+
|
17 |
+
# Instalar dependencias y construir el frontend
|
18 |
+
COPY frontend/package.json frontend/package-lock.json* ./
|
19 |
RUN npm install
|
20 |
+
COPY frontend/ ./
|
21 |
+
RUN npm run build # Construir el frontend
|
22 |
|
23 |
+
# Configurar directorio de trabajo para el 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 todo el c贸digo
|
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"]
|