pcuenq HF staff commited on
Commit
66aaaa7
1 Parent(s): 15f7ffd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -6
Dockerfile CHANGED
@@ -1,11 +1,43 @@
1
- FROM python:3.9
2
 
3
- WORKDIR /code
 
 
 
 
 
 
 
 
4
 
5
- COPY ./requirements.txt /code/requirements.txt
 
 
 
 
 
 
 
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
8
 
9
- COPY . .
 
 
 
10
 
11
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10.14
2
 
3
+ # Install some assorted build and dev libraries
4
+ ARG DEBIAN_FRONTEND=noninteractive
5
+ ENV TZ=Europe/Paris
6
+ RUN apt-get update && apt-get install -y \
7
+ git \
8
+ jq \
9
+ make build-essential libssl-dev zlib1g-dev \
10
+ libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
11
+ libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
12
 
13
+ # User
14
+ RUN useradd -m -u 1000 user
15
+ USER user
16
+ ENV HOME /home/user
17
+ ENV PATH $HOME/.local/bin:$PATH
18
+ WORKDIR $HOME
19
+ RUN mkdir app
20
+ WORKDIR $HOME/app
21
 
22
+ # Build llama.cpp (CPU, only `quantize`)
23
+ # Should we pin a known commit?
24
+ RUN git clone https://github.com/ggerganov/llama.cpp.git
25
+ WORKDIR $HOME/app/llama.cpp
26
+ RUN make quantize
27
+ WORKDIR $HOME/app
28
 
29
+ # App and Python reqs
30
+ # Should we pin versions here?
31
+ COPY --chown=user ./ $HOME/app
32
+ RUN pip install --no-cache-dir -r requirements.txt
33
 
34
+ # These may be enough to trigger a gradio Space
35
+ #ENV PYTHONPATH $HOME/app
36
+ #ENV PYTHONUNBUFFERED 1
37
+ #ENV GRADIO_ALLOW_FLAGGING never
38
+ #ENV GRADIO_NUM_PORTS 1
39
+ #ENV GRADIO_SERVER_NAME 0.0.0.0
40
+ #ENV GRADIO_THEME huggingface
41
+ #ENV SYSTEM spaces
42
+
43
+ CMD ["python", "app.py"]