# Use a base image with Python FROM python:3.10-slim # Copy your code WORKDIR /app COPY . /app # Install dependencies RUN pip install --no-cache-dir -r requirements.txt RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache ENV HF_HOME=/app/.cache ENV HF_DATASETS_CACHE=/app/.cache/datasets ENV TRANSFORMERS_CACHE=/app/.cache/transformers # Expose the port your FastAPI app runs on (e.g. 7860) EXPOSE 7860 # Run your FastAPI app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]