Spaces:
Running
on
T4
Running
on
T4
File size: 994 Bytes
76388ad fda59cf 76388ad f2f9894 76388ad f2f9894 f3c253c 62270ac 76388ad 62270ac fda59cf 76388ad 6630641 4745634 aeec9de 50dd799 547b225 50dd799 547b225 76388ad f3c253c f2f840e 547b225 bef0530 d527190 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends -y \
curl \
build-essential \
python3.9 \
python3-pip \
git \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN curl https://ollama.ai/install.sh | sh
WORKDIR /app
RUN mkdir -p /.ollama && chmod 777 /.ollama
COPY ./requirements.txt /app/requirements.txt
RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
EXPOSE 8501
COPY ./entrypoint.sh /entrypoint.sh
RUN chown root:root /entrypoint.sh\
&& chmod 744 /entrypoint.sh
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:/app/venv/bin:/root/.ollama/bin:$PATH \
PYTHONPATH=$HOME/app \
PYTHONUNBUFFERED=1 \
OLLAMA_HOST=0.0.0.0 \
NVIDIA_VISIBLE_DEVICES=all \
SYSTEM=spaces
WORKDIR $HOME/app
COPY --chown=user . $HOME/app
ENTRYPOINT ["bash", "./entrypoint-ollama.sh"]
CMD ["ollama", "serve"]
EXPOSE 7860 |