forked from josStorer/RWKV-Runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (35 loc) · 1.41 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM node:21-slim AS frontend
RUN echo "registry=https://registry.npmmirror.com/" > ~/.npmrc
WORKDIR /app
COPY manifest.json manifest.json
COPY frontend frontend
WORKDIR /app/frontend
RUN npm ci
RUN npm run build
FROM nvidia/cuda:11.6.1-devel-ubuntu20.04 AS runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -yq git curl wget build-essential ninja-build aria2 jq software-properties-common
RUN add-apt-repository -y ppa:deadsnakes/ppa && \
add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
apt install -y g++-11 python3.10 python3.10-distutils python3.10-dev && \
curl -sS http://mirrors.aliyun.com/pypi/get-pip.py | python3.10
RUN python3.10 -m pip install cmake
FROM runtime AS librwkv
WORKDIR /app
RUN git clone https://github.com/RWKV/rwkv.cpp.git && \
cd rwkv.cpp && \
git submodule update --init --recursive && \
mkdir -p build && \
cd build && \
cmake -G Ninja .. && \
cmake --build .
FROM runtime AS final
WORKDIR /app
COPY ./backend-python/requirements.txt ./backend-python/requirements.txt
RUN python3.10 -m pip install --quiet -r ./backend-python/requirements.txt
COPY . .
COPY --from=frontend /app/frontend/dist /app/frontend/dist
COPY --from=librwkv /app/rwkv.cpp/build/librwkv.so /app/backend-python/rwkv_pip/cpp/librwkv.so
EXPOSE 27777
CMD ["python3.10", "./backend-python/main.py", "--port", "27777", "--host", "0.0.0.0", "--webui"]