m1b2lover commited on
Commit
b36de85
·
verified ·
1 Parent(s): 2f95a1d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -0
Dockerfile ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ARG CUDA_IMAGE="12.5.0-devel-ubuntu22.04"
2
+ FROM nvidia/cuda:${CUDA_IMAGE}
3
+
4
+ # We need to set the host to 0.0.0.0 to allow outside access
5
+ ENV HOST 0.0.0.0
6
+
7
+ RUN apt-get update && apt-get upgrade -y \
8
+ && apt-get install -y git build-essential \
9
+ python3 python3-pip gcc wget \
10
+ ocl-icd-opencl-dev opencl-headers clinfo \
11
+ libclblast-dev libopenblas-dev \
12
+ && mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
13
+
14
+ # ちゃんと書き込みできるユーザー設定しないとエラーが出るっぽい。
15
+ RUN useradd -m -u 1000 gee
16
+ USER gee
17
+ ENV HOME=/home/gee \
18
+ PATH=/home/gee/.local/bin:$PATH
19
+
20
+ ENV HF_HOME=$HOME/app/.cache/huggingface
21
+ WORKDIR $HOME/app
22
+
23
+
24
+ COPY --chown=gee . $HOME/app
25
+
26
+ # setting build related env vars
27
+ ENV CUDA_DOCKER_ARCH=all
28
+ ENV GGML_CUDA=1
29
+
30
+ # Install depencencies
31
+ RUN python3 -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette pydantic-settings starlette-context
32
+
33
+ RUN python3 -m pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu125
34
+ # Install llama-cpp-python (build with cuda)
35
+ # RUN CMAKE_ARGS="-DGGML_CUDA=on" pip install llama-cpp-python
36
+
37
+ # Run the server
38
+ CMD ["python3", "llm.py"]