FROM rust:1-slim-bookworm AS build
WORKDIR /src
COPY Cargo.toml .
COPY daemon daemon
RUN cargo build --release -p irohds-daemon && strip target/release/irohds-daemon

FROM python:3.12-slim-bookworm
RUN pip install --no-cache-dir blake3 coren
COPY --from=build /src/target/release/irohds-daemon /usr/local/bin/
COPY python /opt/irohds/python
COPY tests/p2p/test.py /test.py
COPY tests/p2p/entrypoint.py /entrypoint.py
ENV PYTHONPATH=/opt/irohds/python
ENTRYPOINT ["python3", "/entrypoint.py"]
CMD ["sleep", "infinity"]
