FROM python:3.12-slim # Install system dependencies RUN apt-get update && apt-get install -y git # Set environment variable to avoid permission issues ENV TRANSFORMERS_CACHE=/code/.cache # Set working directory WORKDIR /code # Copy requirements COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the app COPY . . # Create cache directory and give full permissions (just in case) RUN mkdir -p /code/.cache && chmod -R 777 /code/.cache # Expose port 7860 EXPOSE 7860 # Run the FastAPI app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]