Spaces:
Running
Running
MVPilgrim
commited on
Commit
·
c3b8950
1
Parent(s):
9965f51
fda
Browse files- Dockerfile +59 -0
Dockerfile
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
###############################################################################
|
2 |
+
#python environment, main app and startup script.
|
3 |
+
FROM python:3.11.5
|
4 |
+
#FROM python:3.11.9-slim
|
5 |
+
#FROM python:3.11.9-alpine
|
6 |
+
#FROM python:3.11-bookworm
|
7 |
+
|
8 |
+
ENTRYPOINT ["/app/startup.sh"]
|
9 |
+
#RUN apt-get update && \
|
10 |
+
# apt-get install -y libc6 && \
|
11 |
+
# rm -rf /var/lib/apt/lists/*
|
12 |
+
WORKDIR /app
|
13 |
+
|
14 |
+
#RUN ls -l / || ls -l /lib || ls -l /usr || ls -l /usr/lib6 || echo "### An ls failed."
|
15 |
+
|
16 |
+
COPY ./requirements.txt /app/requirements.txt
|
17 |
+
COPY ./semsearch.py /app/semsearch.py
|
18 |
+
COPY ./startup.sh /app/startup.sh
|
19 |
+
RUN chmod 755 /app/startup.sh
|
20 |
+
|
21 |
+
COPY ./multi-qa-MiniLM-L6-cos-v1 /app/multi-qa-MiniLM-L6-cos-v1
|
22 |
+
|
23 |
+
RUN mkdir -p /app/inputDocs
|
24 |
+
COPY ./inputDocs/* /app/inputDocs
|
25 |
+
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
26 |
+
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
|
27 |
+
RUN pip show semantic-text-splitter
|
28 |
+
|
29 |
+
##############################################################################
|
30 |
+
# Install Weaviate
|
31 |
+
WORKDIR /app/weaviate
|
32 |
+
RUN wget -qO- https://github.com/weaviate/weaviate/releases/download/v1.24.10/weaviate-v1.24.10-linux-amd64.tar.gz | tar -xzf -
|
33 |
+
RUN ls -al /app/weaviate
|
34 |
+
|
35 |
+
# Set environment variables for Weaviate
|
36 |
+
ENV PATH="/app:/app/weaviate-v1.24.10-linux-x86_64:${PATH}"
|
37 |
+
# Expose the Weaviate port
|
38 |
+
EXPOSE 8080
|
39 |
+
|
40 |
+
##############################################################################
|
41 |
+
# Install text2vec-transformers
|
42 |
+
WORKDIR /app/text2vec-transformers
|
43 |
+
COPY --from=semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1 /app /app/text2vec-transformers
|
44 |
+
COPY --from=semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1 /usr/local/bin /app/text2vec-transformers/bin
|
45 |
+
|
46 |
+
COPY ./multi-qa-MiniLM-L6-cos-v1 /app/app/text2vec-transformers
|
47 |
+
|
48 |
+
ENV PATH="/app/text2vec-transformers:/app/text2vec-transformers/bin:${PATH}"
|
49 |
+
#RUN pip install -r requirements.txt
|
50 |
+
#RUN pip install nltk==3.8.1 optimum==1.13.2 onnxruntime==1.16.1 onnx==1.14.1
|
51 |
+
RUN ./custom_prerequisites.py
|
52 |
+
|
53 |
+
##############################
|
54 |
+
RUN useradd -m -u 1000 user
|
55 |
+
|
56 |
+
##############################################################################
|
57 |
+
# Start the weaviate vector database, text2vec-transformers and the semantic search app.
|
58 |
+
#RUN /app/startup.sh
|
59 |
+
CMD ["/app/startup.sh"]
|