# Use the official FastAPI image from Hugging Face FROM python:3.10-slim # Set the working directory inside the container WORKDIR /app # Copy the local code to the container COPY . . # Create a writable cache directory within /app RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache # Install dependencies RUN pip install -r requirements.txt # Set the cache directory for Transformers ENV TRANSFORMERS_CACHE /app/.cache # Expose FastAPI port EXPOSE 7860 # Command to run the application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]