Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Co <alex.tuan@mindvalley.com>
  • Loading branch information
onimsha committed Oct 31, 2024
1 parent c264fc7 commit ef82fac
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions backend/Dockerfile.model_server
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11.7-slim-bookworm
FROM nvidia/cuda:12.6.2-base-ubuntu22.04

LABEL com.danswer.maintainer="founders@danswer.ai"
LABEL com.danswer.description="This image is for the Danswer model server which runs all of the \
Expand All @@ -11,26 +11,25 @@ ARG DANSWER_VERSION=0.3-dev
ENV DANSWER_VERSION=${DANSWER_VERSION} \
DANSWER_RUNNING_IN_DOCKER="true"

RUN apt-get update && apt-get install -y curl gpg
ENV DEBIAN_FRONTEND=noninteractive

RUN echo "DANSWER_VERSION: ${DANSWER_VERSION}"
ENV TZ=Etc/UTC

RUN apt-get update && apt install software-properties-common -y

RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
RUN add-apt-repository ppa:deadsnakes/ppa -y

RUN curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
RUN apt-get update && apt-get install -y curl gpg python3.11 python3-pip

RUN apt-get update && apt-get install -y nvidia-container-toolkit
RUN echo "DANSWER_VERSION: ${DANSWER_VERSION}"

COPY ./requirements/model_server.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade \
--retries 5 \
--timeout 30 \
-r /tmp/requirements.txt

RUN apt-get remove -y --allow-remove-essential perl-base && \
apt-get autoremove -y
RUN apt-get autoremove -y

# Pre-downloading models for setups with limited egress
# Download tokenizers, distilbert for the Danswer model
Expand Down

0 comments on commit ef82fac

Please sign in to comment.