FROM python:3.10-slim WORKDIR /app # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all files COPY . . # Optional: avoid using cached Hugging Face models in root directory ENV TRANSFORMERS_CACHE=/app/cache ENV HF_HOME=/app/cache # Set PYTHONPATH (useful if you're importing from app/) ENV PYTHONPATH=/app # HF Spaces default port is 7860 EXPOSE 7860 # Start server CMD ["python", "app.py"]