FROM rust:bookworm AS builder

WORKDIR /src

COPY Cargo.toml Cargo.lock ./
COPY src ./src

RUN cargo build --release

FROM debian:bookworm-slim

RUN apt-get update \
  && apt-get install -y --no-install-recommends ca-certificates \
  && rm -rf /var/lib/apt/lists/*

WORKDIR /workspace

COPY --from=builder /src/target/release/radial_sugiyama /usr/local/bin/radial_sugiyama

CMD ["radial_sugiyama"]
