devve1 commited on
Commit
76388ad
1 Parent(s): 265de71

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -19
Dockerfile CHANGED
@@ -1,29 +1,24 @@
1
- FROM python:3.10-slim-buster
2
 
3
- WORKDIR /app
4
-
5
- COPY requirements.txt requirements.txt
6
-
7
- RUN apt-get update && apt-get install -y curl gnupg && apt-get clean && rm -rf /var/lib/apt/lists/*
8
 
9
- RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
10
- && echo "deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/deb/ $(. /etc/os-release; echo $UBUNTU_CODENAME) main" > /etc/apt/sources.list.d/nvidia-container-toolkit.list
 
 
 
 
 
11
 
12
- RUN apt-get update && apt-get install -y nvidia-container-runtime nvidia-container-toolkit || true
13
-
14
- RUN python -m venv venv && \
15
- . /app/venv/bin/activate && \
16
- pip install --upgrade pip && \
17
- pip install --no-cache-dir -r requirements.txt
18
  RUN curl https://ollama.ai/install.sh | sh
19
 
20
- ENV OLLAMA_HOST=0.0.0.0
21
 
22
  RUN mkdir -p /.ollama && chmod 777 /.ollama
23
 
24
- ENV PATH="/app/venv/bin:/root/.ollama/bin:$PATH"
25
- ENV NVARCH=x86_64
26
- ENV NVIDIA_VISIBLE_DEVICES=all
27
 
28
  EXPOSE 8501
29
 
@@ -35,7 +30,12 @@ RUN useradd -m -u 1000 user
35
  USER user
36
 
37
  ENV HOME=/home/user \
38
- PATH=/home/user/.local/bin:$PATH
 
 
 
 
 
39
 
40
  WORKDIR $HOME/app
41
 
 
1
+ FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
2
 
3
+ ARG DEBIAN_FRONTEND=noninteractive
 
 
 
 
4
 
5
+ RUN apt-get update && apt-get install --no-install-recommends -y \
6
+ curl \
7
+ build-essential \
8
+ python3.9 \
9
+ python3-pip \
10
+ git \
11
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
12
 
 
 
 
 
 
 
13
  RUN curl https://ollama.ai/install.sh | sh
14
 
15
+ WORKDIR /app
16
 
17
  RUN mkdir -p /.ollama && chmod 777 /.ollama
18
 
19
+ COPY ./requirements.txt /app/requirements.txt
20
+
21
+ RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
22
 
23
  EXPOSE 8501
24
 
 
30
  USER user
31
 
32
  ENV HOME=/home/user \
33
+ PATH=/home/user/.local/bin:/app/venv/bin:/root/.ollama/bin:$PATH \
34
+ PYTHONPATH=$HOME/app \
35
+ PYTHONUNBUFFERED=1 \
36
+ OLLAMA_HOST=0.0.0.0 \
37
+ NVIDIA_VISIBLE_DEVICES=all \
38
+ SYSTEM=spaces
39
 
40
  WORKDIR $HOME/app
41