SemanticSearchPOC / Dockerfile
MVPilgrim
Nvidia base image.
cac33b4
raw
history blame
3.17 kB
FROM debian:latest as musl-dev
RUN apt-get update
RUN apt-get install musl
FROM nvidia/cuda:12.6.0-cudnn-runtime-ubuntu24.04 as final
UN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y curl
RUN apt-get install unzip
RUN apt-get -y install python3
RUN apt-get -y install python3-pip
COPY / /
COPY --from=musl-dev /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
COPY --from=python-base /usr/local/lib/python3.11 /usr/local/lib/python3.11
COPY --from=python-base /usr/local/bin/python3.11 /usr/local/bin/python3.11
COPY --from=python-base /usr/local/bin/pip3.11 /usr/local/bin/pip3.11
WORKDIR /app
COPY ./requirements.txt /app/requirements.txt
COPY ./semsearch.py /app/semsearch.py
COPY ./startup.sh /app/startup.sh
COPY ./.streamlit/main.css /app/.streamlit/main.css
COPY ./app.py /app/app.py
RUN chmod 755 /app/startup.sh
COPY ./multi-qa-MiniLM-L6-cos-v1 /app/multi-qa-MiniLM-L6-cos-v1
RUN mkdir -p /app/inputDocs
COPY ./inputDocs/* /app/inputDocs
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
RUN pip install https://files.pythonhosted.org/packages/13/87/e0cb08c2d4bd7d38ab63816b306c8b1e7cfdc0e59bd54462e8b0df069078/semantic_text_splitter-0.6.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
RUN pip show semantic-text-splitter
RUN pip install llama_cpp_python
RUN FORCE_CMAKE=1 CMAKE_SYSTEM_PROCESSOR=AMD64 pip install --verbose --no-cache-dir llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
##############################################################################
# Install Weaviate
WORKDIR /app/weaviate
RUN wget -qO- https://github.com/weaviate/weaviate/releases/download/v1.24.10/weaviate-v1.24.10-linux-amd64.tar.gz | tar -xzf -
RUN ls -al /app/weaviate
# Set environment variables for Weaviate
ENV PATH="/app:/app/weaviate-v1.24.10-linux-x86_64:${PATH}"
# Expose the Weaviate port
EXPOSE 8080
#COPY Llama-2-7B-Chat-GGUF/llama-2-7b-chat.Q4_0.gguf /app
RUN cd /app; wget -v https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/resolve/main/llama-2-7b-chat.Q4_0.gguf
##############################################################################
# Install text2vec-transformers
WORKDIR /app/text2vec-transformers
COPY --from=semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1 /app /app/text2vec-transformers
COPY --from=semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1 /usr/local/bin /app/text2vec-transformers/bin
COPY ./multi-qa-MiniLM-L6-cos-v1 /app/app/text2vec-transformers
ENV PATH="/usr/bin/local:/app/text2vec-transformers:/app/text2vec-transformers/bin:${PATH}"
ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
RUN ./custom_prerequisites.py
##############################
RUN useradd -m -u 1000 user
RUN chmod -R 755 /app
RUN chown -R user /app
RUN chgrp -R user /app
WORKDIR /app
USER user
EXPOSE 8501
CMD streamlit run /app/app.py \
--server.headless true \
--server.enableCORS false \
--server.enableXsrfProtection false \
--server.fileWatcherType none