engine / Dockerfile
VeuReu's picture
Update Dockerfile
f85df4e verified
raw
history blame
1.12 kB
FROM python:3.11-slim
# SO deps necesarias para audio/v铆deo/OCR
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg libsndfile1 libsm6 libxext6 libgl1 tesseract-ocr build-essential sqlite3 libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Crear directorios para cach茅 y dar permisos
RUN mkdir -p /app/data/.cache /app/data/.deepface /app/data/.config/matplotlib \
&& chmod -R 777 /app/data
# Variables de entorno para que librer铆as escriban en /app/data
ENV HOME=/app/data \
DEEPFACE_HOME=/app/data/.deepface \
MPLCONFIGDIR=/app/data/.config/matplotlib \
TRANSFORMERS_CACHE=/app/data/.cache/huggingface \
HF_HOME=/app/data/.cache/huggingface \
XDG_CACHE_HOME=/app/data/.cache \
PORT=7860
# Mejora estabilidad de instalaci贸n de wheels
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# Instala deps primero (mejor cacheo)
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Copia el c贸digo
COPY . /app
# Lanza FastAPI
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]