VeuReu commited on
Commit
af8a801
verified
1 Parent(s): 78b76ad

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -24
Dockerfile CHANGED
@@ -1,24 +1,34 @@
1
- FROM python:3.11-slim
2
-
3
- # SO deps necesarias para audio/v铆deo/OCR
4
- RUN apt-get update && apt-get install -y --no-install-recommends \
5
- ffmpeg libsndfile1 libsm6 libxext6 libgl1 tesseract-ocr build-essential \
6
- && rm -rf /var/lib/apt/lists/*
7
-
8
- WORKDIR /app
9
-
10
- # Mejora estabilidad de instalaci贸n de wheels
11
- RUN pip install --no-cache-dir --upgrade pip setuptools wheel
12
-
13
- # Instala deps primero (mejor cacheo)
14
- COPY requirements.txt /app/
15
- RUN pip install --no-cache-dir -r requirements.txt
16
-
17
- # Copia el c贸digo
18
- COPY . /app
19
-
20
- # Puerto usado por HF Spaces
21
- ENV PORT=7860
22
-
23
- # Lanza FastAPI (ajusta si tu entrypoint NO es main_api.py)
24
- CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # SO deps necesarias para audio/v铆deo/OCR
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ ffmpeg libsndfile1 libsm6 libxext6 libgl1 tesseract-ocr build-essential \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ WORKDIR /app
9
+
10
+ # Crear directorios para cach茅 y dar permisos
11
+ RUN mkdir -p /app/data/.cache /app/data/.deepface /app/data/.config/matplotlib \
12
+ && chmod -R 777 /app/data
13
+
14
+ # Variables de entorno para que librer铆as escriban en /app/data
15
+ ENV HOME=/app/data \
16
+ DEEPFACE_HOME=/app/data/.deepface \
17
+ MPLCONFIGDIR=/app/data/.config/matplotlib \
18
+ TRANSFORMERS_CACHE=/app/data/.cache/huggingface \
19
+ HF_HOME=/app/data/.cache/huggingface \
20
+ XDG_CACHE_HOME=/app/data/.cache \
21
+ PORT=7860
22
+
23
+ # Mejora estabilidad de instalaci贸n de wheels
24
+ RUN pip install --no-cache-dir --upgrade pip setuptools wheel
25
+
26
+ # Instala deps primero (mejor cacheo)
27
+ COPY requirements.txt /app/
28
+ RUN pip install --no-cache-dir -r requirements.txt
29
+
30
+ # Copia el c贸digo
31
+ COPY . /app
32
+
33
+ # Lanza FastAPI
34
+ CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]