|
FROM ubuntu:22.04 |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y \ |
|
build-essential \ |
|
libssl-dev \ |
|
zlib1g-dev \ |
|
libboost-math-dev \ |
|
libboost-python-dev \ |
|
libboost-timer-dev \ |
|
libboost-thread-dev \ |
|
libboost-system-dev \ |
|
libboost-filesystem-dev \ |
|
libopenblas-dev \ |
|
libomp-dev \ |
|
cmake \ |
|
pkg-config \ |
|
git \ |
|
python3-pip \ |
|
curl \ |
|
libcurl4-openssl-dev \ |
|
wget && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN pip3 install huggingface-hub openai gradio |
|
|
|
|
|
RUN git clone https://github.com/ggerganov/llama.cpp && \ |
|
cd llama.cpp && \ |
|
cmake -B build -S . \ |
|
-DLLAMA_BUILD_SERVER=ON \ |
|
-DLLAMA_BUILD_EXAMPLES=ON \ |
|
-DGGML_BLAS=ON \ |
|
-DGGML_BLAS_VENDOR=OpenBLAS \ |
|
-DCMAKE_BUILD_TYPE=Release && \ |
|
cmake --build build --config Release --target llama-server -j $(nproc) |
|
|
|
|
|
RUN mkdir -p /models && \ |
|
wget -O /models/model.q8_0.gguf https://huggingface.co/unsloth/DeepSeek-R1-Distill-Qwen-7B-GGUF/resolve/main/DeepSeek-R1-Distill-Qwen-7B-Q4_K_M.gguf |
|
|
|
|
|
COPY app.py /app.py |
|
COPY start.sh /start.sh |
|
RUN chmod +x /start.sh |
|
|
|
|
|
EXPOSE 7860 8080 |
|
|
|
|
|
CMD ["/start.sh"] |