triflix commited on
Commit
0bb66c8
·
verified ·
1 Parent(s): 595693c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -11
Dockerfile CHANGED
@@ -1,18 +1,42 @@
1
- FROM python:3.11-slim
2
-
3
- WORKDIR /app
4
 
5
  RUN apt-get update && \
6
- apt-get install -y --no-install-recommends gcc g++ cmake && \
7
- pip install --no-cache-dir llama-cpp-python gradio huggingface-hub && \
8
- apt-get purge -y gcc g++ cmake && \
9
- apt-get autoremove -y && \
 
 
 
 
 
 
 
 
 
10
  rm -rf /var/lib/apt/lists/*
11
 
12
- COPY app.py .
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- RUN useradd -m -u 1000 user && chown -R user:user /app
15
- USER user
 
 
 
 
16
 
17
  EXPOSE 7860
18
- CMD ["python", "app.py"]
 
 
1
+ FROM ubuntu:22.04
 
 
2
 
3
  RUN apt-get update && \
4
+ apt-get install -y \
5
+ build-essential \
6
+ libssl-dev \
7
+ zlib1g-dev \
8
+ libopenblas-dev \
9
+ libomp-dev \
10
+ cmake \
11
+ pkg-config \
12
+ git \
13
+ python3-pip \
14
+ curl \
15
+ libcurl4-openssl-dev \
16
+ wget && \
17
  rm -rf /var/lib/apt/lists/*
18
 
19
+ RUN pip3 install --upgrade pip && \
20
+ pip3 install openai fastapi uvicorn pydantic orjson httptools
21
+
22
+ RUN pip install httpx[http2]
23
+
24
+ RUN git clone https://github.com/ggerganov/llama.cpp && \
25
+ cd llama.cpp && \
26
+ cmake -B build -S . \
27
+ -DLLAMA_BUILD_SERVER=ON \
28
+ -DGGML_BLAS=ON \
29
+ -DGGML_BLAS_VENDOR=OpenBLAS \
30
+ -DCMAKE_BUILD_TYPE=Release && \
31
+ cmake --build build --config Release --target llama-server -j $(nproc)
32
 
33
+ RUN mkdir -p /models && \
34
+ wget -O /models/model.gguf https://huggingface.co/unsloth/Qwen3.5-0.8B-GGUF/resolve/main/Qwen3.5-0.8B-Q8_0.gguf
35
+
36
+ COPY app.py /app.py
37
+ COPY start.sh /start.sh
38
+ RUN chmod +x /start.sh
39
 
40
  EXPOSE 7860
41
+
42
+ CMD ["/start.sh"]