Spaces:
Sleeping
Sleeping
File size: 695 Bytes
2b28b2c 4a675a3 2b28b2c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | FROM python:3.11-slim
# Directorio de trabajo
WORKDIR /app
# Dependencias del sistema
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Instalar dependencias Python (PyTorch CPU para menor tamaño)
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir torch==2.10.0 --index-url https://download.pytorch.org/whl/cpu && \
pip install --no-cache-dir -r requirements.txt
# Copiar código del backend
COPY . .
# HF Spaces usa el puerto 7860 por defecto
EXPOSE 7860
# Ejecutar FastAPI con Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|