FROM python:3.9-slim WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . # Create a writable directory for data persistence (if mounted) # In HF Spaces, we can write to /app, but for persistence usually a dataset is better. # For this demo, local file is fine (it resets on restart unless persistent storage is configured in HF). RUN chmod -R 777 /app EXPOSE 7860 CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]