# Use the official Python 3.10.9 image FROM python:3.10.9 # Copy the current directory contents into the container at . COPY . . # Set the working directory to / WORKDIR / RUN pip install python-multipart # Install requirements.txt RUN pip install --no-cache-dir --upgrade -r /requirements.txt # Install LeelaChessZero depencies RUN apt update -y RUN apt install software-properties-common -y RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin RUN mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" RUN apt update -y RUN apt upgrade -y RUN apt install ocl-icd-opencl-dev -y RUN apt install cuda -y RUN apt install zlib1g -y # Make engines executable RUN chmod +x engines/stockfish/* RUN chmod +x engines/maia/lc0 # Start the FastAPI app on port 7860, the default port expected by Spaces CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]