# Use an official lightweight Python/CUDA image FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04 # Install Python and pip RUN apt-get update && apt-get install -y python3-pip python3-dev && rm -rf /var/lib/apt/lists/* # Set the working directory WORKDIR /app # Copy the requirements and install them COPY requirements.txt . RUN pip3 install --no-cache-dir -r requirements.txt # Copy your application code COPY app.py . # Expose the Hugging Face Space port EXPOSE 7860 # Command to run the FastAPI server using Uvicorn CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]