FROM python:3.12-slim WORKDIR /app # Dipendenze di sistema minime (aggiungi qui se te ne servono altre) RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential curl git && \ rm -rf /var/lib/apt/lists/* # Copia dei requisiti PRIMA del codice per sfruttare la cache Docker COPY requirements.txt ./ RUN pip3 install --no-cache-dir -r requirements.txt # Copia del codice COPY src/ ./src/ ENV PORT=7860 EXPOSE 7860 # HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=5 \ # CMD curl -f http://localhost:${PORT}/_stcore/health || curl -f http://localhost:${PORT}/ || exit 1 ENTRYPOINT ["sh", "-c", "echo PORT=${PORT} && streamlit run src/streamlit_app.py --server.port=${PORT} --server.address=0.0.0.0 --server.enableCORS=false --server.enableXsrfProtection=false --server.headless=true"]