Spaces:
Sleeping
Sleeping
| # Imagen base ligera con Python | |
| FROM python:3.11-slim | |
| # Evitar prompts interactivos | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| # Instalar deps del sistema necesarias para faiss/numpy | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential g++ git wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Crear directorio app | |
| WORKDIR /app | |
| # Copiar archivos | |
| COPY requirements.txt /app/ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY app.py /app/ | |
| COPY code /app/code | |
| COPY data /app/data | |
| RUN chmod 777 /app/code | |
| # Variables por defecto (puedes cambiarlas en "Settings -> Variables" del Space) | |
| ENV CSV_PATH=/app/data/songs.csv \ | |
| HF_HOME=/app/code/ \ | |
| GENRE_NAME="Rock & Roll" \ | |
| EMBEDDING_MODEL="sentence-transformers/all-MiniLM-L6-v2" \ | |
| LLM_MODEL="google/flan-t5-small" \ | |
| USE_LLM=1 \ | |
| PORT=7860 \ | |
| HF_HUB_DISABLE_TELEMETRY=1 | |
| # Exponer el puerto requerido por Spaces | |
| EXPOSE 7860 | |
| # Arranque del servidor | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |