Update Dockerfile
Browse files- Dockerfile +9 -14
Dockerfile
CHANGED
|
@@ -1,22 +1,17 @@
|
|
| 1 |
-
# Use the official image
|
| 2 |
FROM ghcr.io/abetlen/llama-cpp-python:latest
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
WORKDIR /
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
#
|
|
|
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
# Ensure 'model/gemma-3-finetuned.Q4_K_M.gguf' exists in your HF Space "Files" tab.
|
| 12 |
-
# We rename it to 'model.gguf' inside the container for simplicity.
|
| 13 |
-
COPY model/gemma-3-finetuned.Q4_K_M.gguf /app/model/model.gguf
|
| 14 |
-
|
| 15 |
-
# 3. Set environment variables for the server
|
| 16 |
ENV HOST=0.0.0.0
|
| 17 |
ENV PORT=7860
|
| 18 |
-
ENV MODEL=/
|
| 19 |
|
| 20 |
# 4. Start the server
|
| 21 |
-
|
| 22 |
-
CMD ["python3", "-m", "llama_cpp.server", "--model", "/app/model/model.gguf", "--host", "0.0.0.0", "--port", "7860", "--n_ctx", "2048"]
|
|
|
|
| 1 |
+
# Use the official image (lightweight and pre-configured)
|
| 2 |
FROM ghcr.io/abetlen/llama-cpp-python:latest
|
| 3 |
|
| 4 |
+
# 1. Change WORKDIR to something neutral to avoid file conflicts
|
| 5 |
+
WORKDIR /workspace
|
| 6 |
|
| 7 |
+
# 2. Copy ONLY the model file.
|
| 8 |
+
# Do NOT use "COPY . ." which brings in broken local folders.
|
| 9 |
+
COPY model/gemma-3-finetuned.Q4_K_M.gguf /workspace/model.gguf
|
| 10 |
|
| 11 |
+
# 3. Set Environment Variables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
ENV HOST=0.0.0.0
|
| 13 |
ENV PORT=7860
|
| 14 |
+
ENV MODEL=/workspace/model.gguf
|
| 15 |
|
| 16 |
# 4. Start the server
|
| 17 |
+
CMD ["python3", "-m", "llama_cpp.server", "--model", "/workspace/model.gguf", "--host", "0.0.0.0", "--port", "7860", "--n_ctx", "2048"]
|
|
|