Update Dockerfile
Browse files- Dockerfile +10 -9
Dockerfile
CHANGED
|
@@ -1,28 +1,29 @@
|
|
| 1 |
-
#
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
ENV PYTHONUNBUFFERED=1
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
-
# Install system
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
gcc g++ make cmake git libopenblas-dev wget \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Install
|
|
|
|
| 14 |
RUN pip install --no-cache-dir \
|
| 15 |
-
https://
|
|
|
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
RUN pip install
|
| 19 |
-
|
| 20 |
-
# Model download
|
| 21 |
RUN python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='HauhauCS/Qwen3.5-4B-Uncensored-HauhauCS-Aggressive', filename='Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf', local_dir='.')"
|
| 22 |
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
-
#
|
|
|
|
| 26 |
CMD ["python3", "-m", "llama_cpp.server", \
|
| 27 |
"--model", "Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf", \
|
| 28 |
"--host", "0.0.0.0", \
|
|
|
|
| 1 |
+
# Python 3.10 is required for these specific wheels
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
ENV PYTHONUNBUFFERED=1
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
# Install basic system tools
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
gcc g++ make cmake git libopenblas-dev wget \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# 1. Install llama-cpp-python from the official CPU wheel index
|
| 14 |
+
# This skips the 'stuck' compilation and provides the latest architecture support
|
| 15 |
RUN pip install --no-cache-dir \
|
| 16 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
|
| 17 |
+
"llama-cpp-python[server]"
|
| 18 |
|
| 19 |
+
# 2. Download the model (Qwen 3.5 4B)
|
| 20 |
+
RUN pip install huggingface_hub
|
|
|
|
|
|
|
| 21 |
RUN python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='HauhauCS/Qwen3.5-4B-Uncensored-HauhauCS-Aggressive', filename='Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf', local_dir='.')"
|
| 22 |
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
+
# 3. Launch the server
|
| 26 |
+
# Note: n_threads is set to 2 to match the Free Tier CPU limit
|
| 27 |
CMD ["python3", "-m", "llama_cpp.server", \
|
| 28 |
"--model", "Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf", \
|
| 29 |
"--host", "0.0.0.0", \
|