forked from oculairmedia/Letta-MCP-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.rust
More file actions
53 lines (41 loc) · 1.31 KB
/
Copy pathDockerfile.rust
File metadata and controls
53 lines (41 loc) · 1.31 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
FROM rustlang/rust:nightly-slim AS chef
RUN cargo install cargo-chef
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
git \
clang \
mold \
&& rm -rf /var/lib/apt/lists/*
RUN git config --global url."https://github.com/".insteadOf git@github.com:
WORKDIR /build
FROM chef AS planner
COPY Cargo.toml Cargo.lock ./
COPY letta-server ./letta-server
COPY letta-types ./letta-types
COPY rust/vendor ./rust/vendor
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY .cargo/config.toml /build/.cargo/config.toml
COPY --from=planner /build/recipe.json recipe.json
RUN rm -rf ~/.cargo/git
RUN cargo chef cook --release --recipe-path recipe.json
COPY Cargo.toml Cargo.lock ./
COPY letta-server ./letta-server
COPY letta-types ./letta-types
COPY rust/vendor ./rust/vendor
RUN cargo build --release --bin letta-server
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 letta
COPY --from=builder /build/target/release/letta-server /usr/local/bin/letta-server
RUN chmod +x /usr/local/bin/letta-server
EXPOSE 6507
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
USER letta
ENV TRANSPORT=http
ENV PORT=6507
CMD ["/usr/local/bin/letta-server"]