dimemex / Dockerfile
julianzrmrz's picture
Update Dockerfile
0b9357d verified
raw
history blame
1.42 kB
# Usamos Python 3.10 Slim
FROM python:3.10-slim
WORKDIR /app
# --- CORRECCI脫N AQU脥 ---
# Reemplazamos libgl1-mesa-glx (obsoleto) por libgl1 (nuevo est谩ndar)
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# --- PASO 2: Actualizar PIP ---
RUN pip install --no-cache-dir --upgrade pip
# --- PASO 3: Stack Cient铆fico (Primero, porque tardan en compilar) ---
RUN pip install --no-cache-dir pandas numpy scikit-learn tqdm
# --- PASO 4: PyTorch CPU (El m谩s pesado, lo instalamos aislado) ---
# Usamos --index-url para forzar la versi贸n ligera de CPU (~150MB vs 2GB)
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
# --- PASO 5: Stack de NLP ---
# Importante: huggingface-hub<1.0 para compatibilidad
RUN pip install --no-cache-dir "huggingface-hub<1.0" transformers nltk
# --- PASO 6: Stack de Visi贸n y Web ---
# Instalamos easyocr al final para que no intente pelear con la versi贸n de torch
RUN pip install --no-cache-dir streamlit opencv-python-headless easyocr
# --- PASO 7: Copiar el C贸digo (Al final para aprovechar cach茅) ---
COPY . .
# --- Configuraci贸n de Arranque ---
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["streamlit", "run", "main.py", "--server.port=8501", "--server.address=0.0.0.0"]