Create Dockerfile
Browse files- Dockerfile +23 -0
Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ghcr.io/ggml-org/llama.cpp:full
|
| 2 |
+
|
| 3 |
+
# 作業ディレクトリを /app に固定(権限問題の回避)
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# 必要なパッケージをインストール
|
| 7 |
+
RUN apt update && apt install -y python3-pip
|
| 8 |
+
|
| 9 |
+
# huggingface_hub のインストール
|
| 10 |
+
RUN pip install -U huggingface_hub
|
| 11 |
+
|
| 12 |
+
# Pythonスクリプトで直接実行
|
| 13 |
+
RUN python3 -c 'from huggingface_hub import hf_hub_download; \
|
| 14 |
+
hf_hub_download(repo_id="lxcorp/Link1-270M-Q8_0-GGUF", \
|
| 15 |
+
filename="link1-270m-q8_0.gguf", \
|
| 16 |
+
local_dir=".", \
|
| 17 |
+
local_dir_use_symlinks=False)'
|
| 18 |
+
|
| 19 |
+
# 念のためファイルが存在するか確認する
|
| 20 |
+
RUN ls -lh /app/link1-270m-q8_0.gguf
|
| 21 |
+
|
| 22 |
+
# CPUでサーバーを起動
|
| 23 |
+
CMD ["--server", "-m", "/app/link1-270m-q8_0.gguf", "--port", "7860", "--host", "0.0.0.0", "-n", "4096"]
|