# Development only. Not for production use.
FROM rust:1.96-slim-trixie

RUN apt-get update && apt-get install -y --no-install-recommends \
        ca-certificates pkg-config perl make cmake clang mold git curl wget \
    && rm -rf /var/lib/apt/lists/*

ENV RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold"
ENV CARGO_HOME=/cargo
ENV CARGO_TARGET_DIR=/target

COPY <<'EOF' /usr/local/bin/bobbin-entrypoint.sh
#!/bin/sh
set -eu
cargo build --release --bin bobbin --package bobbin
exec /target/release/bobbin
EOF
RUN chmod +x /usr/local/bin/bobbin-entrypoint.sh

WORKDIR /src

EXPOSE 8090

ENTRYPOINT ["/usr/local/bin/bobbin-entrypoint.sh"]
