File size: 1,092 Bytes
d6db454
488e489
66aaaa7
 
 
 
530c65f
66aaaa7
 
 
 
 
488e489
66aaaa7
 
 
 
 
 
 
 
488e489
66aaaa7
 
 
 
 
 
488e489
66aaaa7
 
 
 
488e489
dbd0e9a
 
 
 
 
 
 
66aaaa7
dbd0e9a
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
FROM python:3.9

# Install some assorted build and dev libraries
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
RUN apt-get update && apt-get install -y \
        vim \
        git \
		jq \
        make build-essential libssl-dev zlib1g-dev \
        libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
        libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

# User
RUN useradd -m -u 1000 user
USER user
ENV HOME /home/user
ENV PATH $HOME/.local/bin:$PATH
WORKDIR $HOME
RUN mkdir app
WORKDIR $HOME/app

# Build llama.cpp (CPU, only `quantize`)
# Should we pin a known commit?
RUN git clone https://github.com/ggerganov/llama.cpp.git
WORKDIR $HOME/app/llama.cpp
RUN make quantize
WORKDIR $HOME/app

# App and Python reqs
# Should we pin versions here?
COPY --chown=user ./ $HOME/app
RUN pip install --no-cache-dir -r requirements.txt

ENV PYTHONPATH $HOME/app
ENV PYTHONUNBUFFERED 1
ENV GRADIO_ALLOW_FLAGGING never
ENV GRADIO_NUM_PORTS 1
ENV GRADIO_SERVER_NAME 0.0.0.0
ENV GRADIO_THEME huggingface
ENV SYSTEM spaces

CMD ["python", "app.py"]