File size: 883 Bytes
86c31f9 7cc88aa 86c31f9 16ec906 7cc88aa |
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 |
# 构建阶段 - 使用最新 Rust 版本
FROM rust:1.85-bookworm AS builder
# 安装 Node.js 用于构建前端
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs
WORKDIR /app
# 克隆项目
RUN git clone https://github.com/AmethystDev-Labs/kiro.rs.git .
# 构建前端
RUN cd admin-ui && npm install && npm run build
# 构建 Rust 项目
RUN cargo build --release
# 运行阶段
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 从构建阶段复制二进制文件
COPY --from=builder /app/target/release/kiro-rs .
COPY --from=builder /app/admin-ui/dist ./admin-ui/dist
# 复制配置文件
COPY config.json .
# HF Spaces 要求监听 7860 端口
EXPOSE 7860
# 启动命令
CMD ["./kiro-rs", "-c", "/app/config.json"] |