Spaces:
Starting
on
T4
Starting
on
T4
Update Dockerfile
Browse files- Dockerfile +19 -19
Dockerfile
CHANGED
@@ -1,29 +1,24 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
-
|
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
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
21 |
|
22 |
RUN mkdir -p /.ollama && chmod 777 /.ollama
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
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 |
|