File size: 3,172 Bytes
6da37cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
###############################################################################
#python environment, main app and startup script.
FROM python:3.11.5
#FROM python:3.11.9-slim
#FROM python:3.11.9-alpine
#FROM python:3.11-bookworm

RUN echo "\n\n############################################# Dockerfile DbgUI ######################################\n\n"

#ENTRYPOINT ["/app/startup.sh"]
#RUN apt-get update && \
#    apt-get install -y libc6 && \
#    rm -rf /var/lib/apt/lists/*
WORKDIR /app

#RUN  ls -l / || ls -l /lib || ls -l /usr || ls -l /usr/lib6 || echo "### An ls failed."

COPY ./requirements.txt /app/requirements.txt
COPY ./semsearch.py     /app/semsearch.py
COPY ./startup.sh       /app/startup.sh
COPY ./semsearchDbgUI.py     /app/semsearchDbgUI.py
COPY ./startupDbgUI.sh       /app/startupDbgUI.sh
RUN  chmod 755          /app/startup.sh /app/startupDbgUI.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

##############################################################################
# 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="/app/text2vec-transformers:/app/text2vec-transformers/bin:${PATH}"
#RUN pip install -r requirements.txt
#RUN pip install nltk==3.8.1 optimum==1.13.2 onnxruntime==1.16.1 onnx==1.14.1
RUN ./custom_prerequisites.py


##############################
RUN useradd -m -u 1000 user

#############################################
# Specify /data volume.
#VOLUME /data

##############################################################################
# Start the weaviate vector database, text2vec-transformers and the semantic search app.
#RUN /app/startup.sh
#RUN --mount=type=cache,target=/data,mode=777 /app/startup.sh
#RUN --mount=type=cache,target=/data,mode=777 echo "### Mounting /data"
#CMD ["/app/startup.sh"]
CMD ["/app/startupDbgUI.sh"]