| # 1. Python 3.11 è la scelta più sicura per i modelli AI su Hugging Face | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # 2. Installiamo cmake: fondamentale per gestire il motore GGUF | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| git \ | |
| cmake \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 3. Copiamo i file (prima requirements per sfruttare la cache) | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # 4. Copiamo tutto il resto (codice e logo) | |
| COPY . . | |
| # 5. Porta obbligatoria per Hugging Face | |
| EXPOSE 7860 | |
| # 6. Comando di avvio con porta corretta e percorso al tuo file | |
| CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"] |