FROM python:3.10-slim # Install necessary OS packages RUN apt-get update && apt-get install -y \ git \ gcc \ libffi-dev \ libssl-dev \ build-essential \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for caching COPY requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt # Copy entire app WORKDIR /app COPY app /app # Set transformers cache to local model folder (optional) ENV TRANSFORMERS_CACHE=/app/app/model # Run FastAPI EXPOSE 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]