# Use official slim Python image FROM python:3.8-slim WORKDIR /app # Copy project files COPY . /app # Upgrade pip and install dependencies RUN pip install --upgrade pip RUN pip install -r requirements.txt # Expose port used by HF Spaces Docker (default 7860) EXPOSE 7860 # Set environment variables for Hugging Face cache ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers ENV HF_HOME=/tmp/huggingface # Start the Flask app CMD ["python", "app.py"]