Update Dockerfile
Browse files- Dockerfile +4 -43
Dockerfile
CHANGED
@@ -4,37 +4,11 @@ ARG DEBIAN_FRONTEND=noninteractive
|
|
4 |
|
5 |
RUN apt-get update && apt-get install --no-install-recommends -y \
|
6 |
build-essential \
|
7 |
-
python3.11 \
|
8 |
-
python3-pip \
|
9 |
-
python3.11-dev \
|
10 |
-
python3.11-venv \
|
11 |
-
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
12 |
-
|
13 |
-
WORKDIR /app
|
14 |
-
|
15 |
-
RUN python3.11 -m venv /opt/venv
|
16 |
-
ENV PATH=/opt/venv/bin:$PATH \
|
17 |
-
NVIDIA_VISIBLE_DEVICES=all \
|
18 |
-
NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
19 |
-
|
20 |
-
COPY ./requirements.txt /app/requirements.txt
|
21 |
-
RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
|
22 |
-
|
23 |
-
FROM qdrant/qdrant:latest
|
24 |
-
|
25 |
-
ARG DEBIAN_FRONTEND=noninteractive
|
26 |
-
|
27 |
-
RUN apt-get update && apt-get install --no-install-recommends -y \
|
28 |
-
curl \
|
29 |
-
gnupg \
|
30 |
-
build-essential \
|
31 |
-
nvidia-docker2 \
|
32 |
ffmpeg \
|
33 |
libsm6 \
|
34 |
libxext6 \
|
35 |
python3-pip \
|
36 |
python3-dev \
|
37 |
-
python3-venv \
|
38 |
ninja-build \
|
39 |
libmagic-dev \
|
40 |
pandoc>=2.14.2 \
|
@@ -44,19 +18,10 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
|
44 |
git \
|
45 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
46 |
|
47 |
-
RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
|
48 |
-
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
|
49 |
-
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
|
50 |
-
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
|
51 |
-
|
52 |
-
RUN apt-get update && apt-get install --no-install-recommends -y nvidia-container-toolkit
|
53 |
-
|
54 |
WORKDIR /app
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
NVIDIA_VISIBLE_DEVICES=all \
|
59 |
-
NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
60 |
|
61 |
RUN CMAKE_ARGS="-DLLAMA_CUDA=on" pip3 install --no-cache-dir llama-cpp-python
|
62 |
|
@@ -64,7 +29,7 @@ RUN useradd -m -u 1000 user
|
|
64 |
USER user
|
65 |
|
66 |
ENV HOME=/home/user \
|
67 |
-
PATH=/home/user/.local/bin
|
68 |
PYTHONPATH=$HOME/app \
|
69 |
PYTHONUNBUFFERED=1 \
|
70 |
NVIDIA_VISIBLE_DEVICES=all \
|
@@ -72,15 +37,11 @@ ENV HOME=/home/user \
|
|
72 |
SYSTEM=spaces \
|
73 |
HF_HOME=/data/.huggingface
|
74 |
|
75 |
-
COPY --from=builder /opt/venv /opt/venv
|
76 |
-
|
77 |
WORKDIR $HOME/app
|
78 |
|
79 |
COPY --chown=user . $HOME/app
|
80 |
|
81 |
-
EXPOSE 8501
|
82 |
-
|
83 |
-
VOLUME ["${HF_HOME}/qdrant_storage:/qdrant/storage:z"]
|
84 |
|
85 |
CMD streamlit run app.py \
|
86 |
--server.headless true \
|
|
|
4 |
|
5 |
RUN apt-get update && apt-get install --no-install-recommends -y \
|
6 |
build-essential \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
ffmpeg \
|
8 |
libsm6 \
|
9 |
libxext6 \
|
10 |
python3-pip \
|
11 |
python3-dev \
|
|
|
12 |
ninja-build \
|
13 |
libmagic-dev \
|
14 |
pandoc>=2.14.2 \
|
|
|
18 |
git \
|
19 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
WORKDIR /app
|
22 |
|
23 |
+
COPY ./requirements.txt /app/requirements.txt
|
24 |
+
RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
|
|
|
|
|
25 |
|
26 |
RUN CMAKE_ARGS="-DLLAMA_CUDA=on" pip3 install --no-cache-dir llama-cpp-python
|
27 |
|
|
|
29 |
USER user
|
30 |
|
31 |
ENV HOME=/home/user \
|
32 |
+
PATH=/home/user/.local/bin:$PATH \
|
33 |
PYTHONPATH=$HOME/app \
|
34 |
PYTHONUNBUFFERED=1 \
|
35 |
NVIDIA_VISIBLE_DEVICES=all \
|
|
|
37 |
SYSTEM=spaces \
|
38 |
HF_HOME=/data/.huggingface
|
39 |
|
|
|
|
|
40 |
WORKDIR $HOME/app
|
41 |
|
42 |
COPY --chown=user . $HOME/app
|
43 |
|
44 |
+
EXPOSE 8501
|
|
|
|
|
45 |
|
46 |
CMD streamlit run app.py \
|
47 |
--server.headless true \
|