-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (23 loc) · 985 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (23 loc) · 985 Bytes
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
# syntax=docker/dockerfile:1
# Build with musl for a fully static binary (no dynamic libc dependencies)
FROM rust:1.96 AS builder
ENV PATH="/root/.cargo/bin:${PATH}"
# Install musl target and the musl-gcc compiler needed by ring
RUN rustup target add x86_64-unknown-linux-musl \
&& apt-get update && apt-get install -y --no-install-recommends musl-tools \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Copy source
COPY . .
# Build with caching and musl toolchain
RUN --mount=type=cache,id=ltengine-cargo-registry,target=/root/.cargo/registry \
--mount=type=cache,id=ltengine-target,target=/build/target \
cargo build --target x86_64-unknown-linux-musl --release -p ltengine && \
cp target/x86_64-unknown-linux-musl/release/ltengine /ltengine
# Runtime: completely static binary with no external dependencies
FROM scratch
COPY --from=builder /ltengine /ltengine
ENV LTE_BACKEND_HOST=localhost:11434
ENV LTE_MODEL=gemma3-4b
EXPOSE 5050
CMD ["/ltengine"]