StarrySkyWorld commited on
Commit
0830ff8
·
verified ·
1 Parent(s): 9ba8e85

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -8
Dockerfile CHANGED
@@ -1,23 +1,25 @@
1
- # 阶段1: 构建前端
 
 
 
 
2
  FROM node:22-alpine AS frontend-builder
 
 
3
  WORKDIR /app/admin-ui
4
- COPY admin-ui/package.json admin-ui/pnpm-lock.yaml* ./
5
  RUN npm install -g pnpm && pnpm install
6
- COPY admin-ui ./
7
  RUN pnpm build
8
 
9
- # 阶段2: 构建 Rust 后端
10
  FROM rustlang/rust:nightly AS builder
11
  WORKDIR /app
12
- RUN git clone https://github.com/AmethystDev-Labs/kiro.rs.git .
13
  COPY --from=frontend-builder /app/admin-ui/dist /app/admin-ui/dist
14
  RUN cargo build --release --features embed-admin-ui
15
 
16
- # 阶段3: 最终运行镜像
17
  FROM debian:bookworm-slim
18
  RUN apt-get update && \
19
- apt-get install -y ca-certificates curl openssl jq xxd && \
20
- rm -rf /var/lib/apt/lists/*
21
  WORKDIR /app
22
  COPY --from=builder /app/target/release/kiro-rs /app/kiro-rs
23
  COPY start.sh /app/start.sh
 
1
+ FROM alpine:3.21 AS source
2
+ RUN apk add --no-cache git
3
+ WORKDIR /app
4
+ RUN git clone --depth=1 https://github.com/AmethystDev-Labs/kiro.rs.git .
5
+
6
  FROM node:22-alpine AS frontend-builder
7
+ WORKDIR /app
8
+ COPY --from=source /app /app
9
  WORKDIR /app/admin-ui
 
10
  RUN npm install -g pnpm && pnpm install
 
11
  RUN pnpm build
12
 
 
13
  FROM rustlang/rust:nightly AS builder
14
  WORKDIR /app
15
+ COPY --from=source /app /app
16
  COPY --from=frontend-builder /app/admin-ui/dist /app/admin-ui/dist
17
  RUN cargo build --release --features embed-admin-ui
18
 
 
19
  FROM debian:bookworm-slim
20
  RUN apt-get update && \
21
+ apt-get install -y ca-certificates curl openssl jq xxd && \
22
+ rm -rf /var/lib/apt/lists/*
23
  WORKDIR /app
24
  COPY --from=builder /app/target/release/kiro-rs /app/kiro-rs
25
  COPY start.sh /app/start.sh