# Use Python 3.10 or later FROM python:3.10 # Set the working directory WORKDIR /app # Set Hugging Face cache directory ENV HF_HOME=/huggingface ENV TRANSFORMERS_CACHE=/huggingface/cache # Ensure cache directory exists RUN mkdir -p /huggingface/cache # Copy files COPY requirements.txt app.py ./ # Install dependencies and store cache RUN pip install -r requirements.txt # Expose port for FastAPI EXPOSE 7860 # Run FastAPI app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]