-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (46 loc) · 1.84 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (46 loc) · 1.84 KB
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
56
# ── Stage 1: Build frontend ─────────────────────────────────────────
FROM node:22-alpine AS frontend
WORKDIR /app/web
COPY web/package.json web/package-lock.json* ./
RUN npm ci --ignore-scripts
COPY web/ .
RUN npm run build
# ── Stage 2: Build Rust binary ─────────────────────────────────────
FROM rust:1.88-bookworm AS builder
RUN apt-get update && apt-get install -y \
cmake pkg-config libssl-dev protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Cache dependencies first
COPY Cargo.toml Cargo.lock ./
COPY src/ src/
COPY prompts/ prompts/
COPY templates/ templates/
RUN cargo build --release --no-default-features
# ── Stage 3: Runtime ───────────────────────────────────────────────
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
ca-certificates python3 python3-pip \
curl jq poppler-utils \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /peerclaw
# Copy binary
COPY --from=builder /app/target/release/peerclaw /usr/local/bin/peerclaw
# Copy frontend dist
COPY --from=frontend /app/web/dist /peerclaw/web/dist
# Copy templates and prompts
COPY templates/ /peerclaw/templates/
COPY prompts/ /peerclaw/prompts/
# Data directory
RUN mkdir -p /data/.peerclaw
ENV PEERCLAWD_HOME=/data/.peerclaw
ENV PEERCLAW_WEB_DIST=/peerclaw/web/dist
ENV RUST_LOG=peerclaw=info
# Default port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
CMD curl -sf http://localhost:8080/api/status || exit 1
# Default: serve with web dashboard, connect to Ollama on host
ENTRYPOINT ["peerclaw"]
CMD ["serve", "--web", "0.0.0.0:8080", "--ollama"]