FROM rust:1.77-slim-bookworm AS builder

WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY src/ src/

RUN cargo build --release && \
    cp target/release/react-auditor /usr/local/bin/react-auditor

FROM debian:bookworm-slim

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

COPY --from=builder /usr/local/bin/react-auditor /usr/local/bin/react-auditor

ENTRYPOINT ["react-auditor"]
CMD ["--help"]
