Update Dockerfile
Browse files- Dockerfile +31 -28
Dockerfile
CHANGED
|
@@ -1,34 +1,37 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
RUN apt-get update && apt-get install -y
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
RUN
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
| 30 |
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
-
|
| 34 |
-
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "120"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Install build dependencies
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
build-essential \
|
| 6 |
+
cmake \
|
| 7 |
+
git \
|
| 8 |
+
curl \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# Build llama.cpp from source (CPU only)
|
| 12 |
+
RUN git clone https://github.com/ggerganov/llama.cpp /opt/llama.cpp && \
|
| 13 |
+
cd /opt/llama.cpp && \
|
| 14 |
+
mkdir build && \
|
| 15 |
+
cd build && \
|
| 16 |
+
cmake .. -DGGML_CUDA=OFF -DGGML_METAL=OFF && \
|
| 17 |
+
cmake --build . --config Release -j$(nproc)
|
| 18 |
+
|
| 19 |
+
# The main server binary (new name after recent refactor)
|
| 20 |
+
# It could be: llama-server, llama-cli, or server depending on version
|
| 21 |
+
RUN ls -la /opt/llama.cpp/build/bin/ || ls -la /opt/llama.cpp/build/
|
| 22 |
+
|
| 23 |
+
# Download a small GGUF model (~1-2B params)
|
| 24 |
+
RUN mkdir -p /opt/models && \
|
| 25 |
+
curl -L -o /opt/models/smollm2-1.7b-instruct-q4_k_m.gguf \
|
| 26 |
+
"https://huggingface.co/bartowski/SmolLM2-1.7B-Instruct-GGUF/resolve/main/SmolLM2-1.7B-Instruct-Q4_K_M.gguf"
|
| 27 |
+
|
| 28 |
+
# Install Python dependencies
|
| 29 |
+
WORKDIR /app
|
| 30 |
+
COPY requirements.txt .
|
| 31 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 32 |
+
|
| 33 |
+
COPY . .
|
| 34 |
|
| 35 |
EXPOSE 7860
|
| 36 |
|
| 37 |
+
CMD ["python", "app.py"]
|
|
|