# Use an official Python image with CUDA support if using GPU FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 # Set working directory WORKDIR /app # Install dependencies RUN apt-get update && apt-get install -y \ python3-pip \ && rm -rf /var/lib/apt/lists/* ENV TRANSFORMERS_CACHE=/app/cache RUN mkdir -p /app/cache && chmod -R 777 /app/cache # Copy the required files COPY requirements.txt requirements.txt COPY app.py app.py # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Expose port for FastAPI EXPOSE 7860 # Run the application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]