FROM rust:1-bookworm AS builder WORKDIR /app # All compile-time data (compliance mappings, LoCoMo reference suite, the # deprecation register) lives under rust/data/ so this single COPY — and # `cargo publish` — see everything `include_str!` needs. COPY rust ./rust # The cloud API is a feature-gated example target (`required-features = ["cloud-server"]`), # so it must be built with `--example`; the artifact lands in target/release/examples/. RUN cd rust && cargo build --release --features cloud-server --example lean-ctx-cloud-api FROM debian:bookworm-slim # ca-certificates: outbound TLS (SMTP, etc.). fonts-dejavu-core: resvg rasterizes the # Wrapped OG card to PNG and needs a real sans family present, or headline text renders blank. RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates fonts-dejavu-core \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /app/rust/target/release/examples/lean-ctx-cloud-api /usr/local/bin/lean-ctx-cloud-api ENV LEANCTX_CLOUD_BIND_HOST=0.0.0.0 ENV LEANCTX_CLOUD_BIND_PORT=8088 EXPOSE 8088 CMD ["lean-ctx-cloud-api"]