sparkleman commited on
Commit
fbca94e
·
1 Parent(s): 1b68e82
Files changed (1) hide show
  1. Dockerfile +16 -13
Dockerfile CHANGED
@@ -1,13 +1,8 @@
1
- ARG CUDA_IMAGE="12.4.0-runtime-ubuntu22.04"
2
- FROM nvidia/cuda:${CUDA_IMAGE}
 
3
 
4
- RUN <<EOF
5
- apt update
6
- apt install --no-install-recommends -y \
7
- build-essential \
8
- git
9
- apt clean && rm -rf /var/lib/apt/lists/*
10
- EOF
11
 
12
  # 安装Node.js和npm
13
  RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
@@ -16,12 +11,19 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
16
  # 安装pnpm
17
  RUN npm install -g pnpm
18
 
19
- # 克隆前端仓库并构建
20
- RUN git clone https://github.com/SolomonLeon/web-rwkv-realweb.git /frontend
21
- WORKDIR /frontend
22
  RUN pnpm install && pnpm run build
23
 
24
- COPY /frontend/dist $HOME/dist-frontend
 
 
 
 
 
 
 
 
 
 
25
 
26
  COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
27
 
@@ -37,6 +39,7 @@ WORKDIR $HOME/app
37
 
38
  COPY --chown=user . $HOME/app
39
 
 
40
 
41
  RUN uv sync --frozen --extra cu124
42
 
 
1
+ FROM node:20-alpine AS FrontendBuilder
2
+ RUN apk add --no-cache libc6-compat
3
+ WORKDIR /app
4
 
5
+ RUN git clone https://github.com/SolomonLeon/web-rwkv-realweb.git
 
 
 
 
 
 
6
 
7
  # 安装Node.js和npm
8
  RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
 
11
  # 安装pnpm
12
  RUN npm install -g pnpm
13
 
 
 
 
14
  RUN pnpm install && pnpm run build
15
 
16
+ ARG CUDA_IMAGE="12.4.0-runtime-ubuntu22.04"
17
+ FROM nvidia/cuda:${CUDA_IMAGE} AS Backend
18
+
19
+ RUN <<EOF
20
+ apt update
21
+ apt install --no-install-recommends -y \
22
+ build-essential \
23
+ git
24
+ apt clean && rm -rf /var/lib/apt/lists/*
25
+ EOF
26
+
27
 
28
  COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
29
 
 
39
 
40
  COPY --chown=user . $HOME/app
41
 
42
+ COPY --chown=user --from=FrontendBuilder /app/dist $HOME/app/dist-frontend
43
 
44
  RUN uv sync --frozen --extra cu124
45