Update Dockerfile
Browse files- Dockerfile +32 -6
Dockerfile
CHANGED
|
@@ -2,25 +2,51 @@ FROM ubuntu:24.04
|
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && \
|
| 6 |
-
apt-get install -y
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
rm -rf /var/lib/apt/lists/*
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
WORKDIR /app
|
| 10 |
|
|
|
|
| 11 |
RUN git clone https://github.com/ggml-org/llama.cpp.git
|
| 12 |
|
|
|
|
| 13 |
WORKDIR /app/llama.cpp
|
| 14 |
|
| 15 |
RUN cmake -B build
|
| 16 |
-
RUN cmake --build build -j4
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
-
RUN
|
| 23 |
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
-
CMD ["/app/llama.cpp/build/bin/llama-server",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
|
| 5 |
+
# Install dependencies
|
| 6 |
RUN apt-get update && \
|
| 7 |
+
apt-get install -y \
|
| 8 |
+
git \
|
| 9 |
+
build-essential \
|
| 10 |
+
cmake \
|
| 11 |
+
python3 \
|
| 12 |
+
python3-pip \
|
| 13 |
+
python3-venv \
|
| 14 |
+
curl && \
|
| 15 |
rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
+
# Create Python virtual environment
|
| 18 |
+
RUN python3 -m venv /opt/venv
|
| 19 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
| 20 |
+
|
| 21 |
+
# Upgrade pip
|
| 22 |
+
RUN pip install --upgrade pip
|
| 23 |
+
|
| 24 |
+
# Install Hugging Face Hub
|
| 25 |
+
RUN pip install --no-cache-dir huggingface_hub
|
| 26 |
+
|
| 27 |
+
# Working directory
|
| 28 |
WORKDIR /app
|
| 29 |
|
| 30 |
+
# Clone llama.cpp
|
| 31 |
RUN git clone https://github.com/ggml-org/llama.cpp.git
|
| 32 |
|
| 33 |
+
# Build llama.cpp
|
| 34 |
WORKDIR /app/llama.cpp
|
| 35 |
|
| 36 |
RUN cmake -B build
|
|
|
|
| 37 |
|
| 38 |
+
RUN cmake --build build -j$(nproc)
|
| 39 |
|
| 40 |
+
# Download GGUF model
|
| 41 |
+
WORKDIR /app
|
| 42 |
|
| 43 |
+
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='bartowski/Qwen2.5-Coder-1.5B-Instruct-GGUF', filename='Qwen2.5-Coder-1.5B-Instruct-Q6_K.gguf', local_dir='/app/model')"
|
| 44 |
|
| 45 |
EXPOSE 7860
|
| 46 |
|
| 47 |
+
CMD ["/app/llama.cpp/build/bin/llama-server", \
|
| 48 |
+
"-m", "/app/model/Qwen2.5-Coder-1.5B-Instruct-Q6_K.gguf", \
|
| 49 |
+
"--host", "0.0.0.0", \
|
| 50 |
+
"--port", "7860", \
|
| 51 |
+
"-c", "32768", \
|
| 52 |
+
"-ngl", "0"]
|