# Base image FROM nvidia/cuda:11.8.0-base-ubuntu22.04 # Install necessary dependencies RUN apt-get update && apt-get install -y \ curl \ gnupg2 \ software-properties-common # Install CUDA and cuDNN RUN apt-get install -y cuda=11.8.0-1 RUN apt-get install -y libcudnn8=8.9.2.26-1+cuda11.8 RUN apt-get install -y libcudnn8-dev=8.9.2.26-1+cuda11.8 # Add CUDA to PATH and ensure LD_LIBRARY_PATH includes the multiarch directory RUN echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> /etc/profile.d/cuda-path.sh && \ echo 'export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}:/usr/local/cuda/lib64' >> /etc/profile.d/cuda-path.sh && \ echo 'export CUDA_HOME=/usr/local/cuda' >> /etc/profile.d/cuda-path.sh # Install Typesense GPU dependencies RUN curl -O https://dl.typesense.org/releases/28.0/typesense-gpu-deps-28.0-amd64.deb && \ apt-get install -y ./typesense-gpu-deps-28.0-amd64.deb # Download and install Typesense RUN curl -O https://dl.typesense.org/releases/28.0/typesense-server-28.0-linux-amd64.tar.gz && \ tar -xzf typesense-server-28.0-linux-amd64.tar.gz && \ mv typesense-server /usr/bin/typesense-server && \ rm typesense-server-28.0-linux-amd64.tar.gz #Remove duplicate library files causing clash RUN rm -rf \ /usr/lib/x86_64-linux-gnu/libcuda.so.1 \ /usr/lib/x86_64-linux-gnu/libnvcuvid.so.1 \ /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 \ /usr/lib/x86_64-linux-gnu/libcudadebugger.so.1 # Expose the Typesense port EXPOSE 8108 # Set the entrypoint to the Typesense server ENTRYPOINT ["/usr/bin/typesense-server"] # Default command arguments CMD ["--data-dir", "/data", "--api-key", "xyz"]