RWKV-LatestSpace / Dockerfile
sparkleman
FIX
1cec055
raw
history blame
987 Bytes
FROM node:20-alpine AS FrontendBuilder
RUN apk add --no-cache libc6-compat
WORKDIR /app
RUN git clone https://github.com/SolomonLeon/web-rwkv-realweb.git
# 安装Node.js和npm
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y nodejs
# 安装pnpm
RUN npm install -g pnpm
RUN pnpm install && pnpm run build
FROM nvidia/cuda:12.4.0-runtime-ubuntu22.04 AS Backend
RUN <<EOF
apt update
apt install --no-install-recommends -y \
build-essential \
git
apt clean && rm -rf /var/lib/apt/lists/*
EOF
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY . .
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
COPY --chown=user . $HOME/app
COPY --chown=user --from=FrontendBuilder /app/dist $HOME/app/dist-frontend
RUN uv sync --frozen --extra cu124
CMD ["uv","run","app.py","--config_file","./config.production.yaml"]