# Usa un'immagine base di Python FROM python:3.10-slim # Imposta la workdir WORKDIR /app # Installa le dipendenze di sistema necessarie (es. per pyvis o compilatori) RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ && rm -rf /var/lib/apt/lists/* # Copia i requirements e installali COPY requirements.txt . RUN pip3 install -r requirements.txt RUN python -m nltk.downloader punkt punkt_tab RUN python -m spacy download it_core_news_sm # Copia tutto il codice dell'applicazione COPY . . # Espone la porta usata da Hugging Face Spaces (7860) EXPOSE 7860 # Healthcheck per monitorare lo stato dello space (corretta porta 7860) HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health # Comando di avvio specifico per Streamlit su Docker ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]