FROM python:3.10-slim WORKDIR /app # Set the HuggingFace Transformers cache directory ENV TRANSFORMERS_CACHE=/app/cache # Create the cache directory and ensure it's writable RUN mkdir -p /app/cache && chmod -R 777 /app/cache # Install system dependencies RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* # Copy files and install dependencies COPY requirements.txt . RUN pip install --upgrade pip && pip install -r requirements.txt # Copy app code COPY main.py . # Run the FastAPI app CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]