-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (39 loc) · 1.67 KB
/
Dockerfile
File metadata and controls
50 lines (39 loc) · 1.67 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
# ── Stage 1: build ─────────────────────────────────────────────────────────
FROM rust:latest AS builder
WORKDIR /build
# Cache dependency compilation separately from source
COPY Cargo.toml Cargo.lock ./
COPY chisel-core/Cargo.toml chisel-core/Cargo.toml
COPY chisel/Cargo.toml chisel/Cargo.toml
RUN mkdir -p chisel-core/src chisel/src \
&& echo '' > chisel-core/src/lib.rs \
&& echo 'fn main(){}' > chisel/src/main.rs \
&& cargo build --release -p chisel \
&& rm -rf chisel-core/src chisel/src
COPY chisel-core ./chisel-core
COPY chisel ./chisel
# Touch main.rs so cargo rebuilds only our code, not deps
RUN touch chisel/src/main.rs && cargo build --release -p chisel
# ── Stage 2: runtime ────────────────────────────────────────────────────────
FROM debian:bookworm-slim
# Install minimal runtime libs (openssl for TLS, ca-certs for HTTPS tool calls)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libssl3 \
grep \
findutils \
coreutils \
sed \
gawk \
diffutils \
file \
&& rm -rf /var/lib/apt/lists/*
# Non-root user
RUN useradd -r -s /bin/false chisel
COPY --from=builder /build/target/release/chisel /usr/local/bin/chisel
# Data directory — operators mount their project directory here
RUN mkdir /data && chown chisel:chisel /data
USER chisel
EXPOSE 3000
# Secret is supplied at runtime via MCP_APP_SECRET environment variable
CMD ["chisel", "--root", "/data"]