# Use a lightweight Python 3.9 base image FROM python:3.9-slim # Set working directory inside the container WORKDIR /app # Copy all project files into the container COPY . . # Install dependencies from requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Expose Streamlit’s default port EXPOSE 8501 # Run Streamlit app on container startup # --server.address=0.0.0.0 → makes Streamlit reachable from outside the container # --server.port=8501 → fixed port # --server.enableXsrfProtection=false → needed for batch API calls (HuggingFace Spaces fix) CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"] # NOTE: # XSRF protection is disabled ONLY to allow batch API requests without failing.