zhengr commited on
Commit
081cfa2
·
verified ·
1 Parent(s): 7c106d2

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM continuumio/miniconda3:23.10.0-1
2
+
3
+ COPY . /opt/inference
4
+
5
+ ENV NVM_DIR /usr/local/nvm
6
+ ENV NODE_VERSION 14.21.1
7
+
8
+ RUN apt-get -y update \
9
+ && apt install -y build-essential curl procps git libgl1 \
10
+ && mkdir -p $NVM_DIR \
11
+ && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
12
+ && . $NVM_DIR/nvm.sh \
13
+ && nvm install $NODE_VERSION \
14
+ && nvm alias default $NODE_VERSION \
15
+ && nvm use default \
16
+ && apt-get -yq clean
17
+
18
+ ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
19
+
20
+ # Copy the entry point script
21
+ COPY entrypoint.sh /entrypoint.sh
22
+ RUN chmod +x /entrypoint.sh
23
+
24
+ ARG PIP_INDEX=https://pypi.org/simple
25
+ RUN python -m pip install --upgrade -i "$PIP_INDEX" pip && \
26
+ pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \
27
+ pip install -i "$PIP_INDEX" --upgrade-strategy only-if-needed -r /opt/inference/xinference/deploy/docker/requirements_cpu.txt && \
28
+ pip install "llama-cpp-python==0.2.77" --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu && \
29
+ cd /opt/inference && \
30
+ python setup.py build_web && \
31
+ git restore . && \
32
+ pip install -i "$PIP_INDEX" --no-deps "." && \
33
+ # clean packages
34
+ pip cache purge
35
+
36
+ # 设置ENTRYPOINT
37
+ ENTRYPOINT ["/entrypoint.sh"]