FROM ubuntu:24.04

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

# Use geth binary instead of XDC (cmd/XDC removed, Issue #201)
COPY build/bin/geth /usr/local/bin/geth
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

EXPOSE 8545 8546 30303 30303/udp

# Use entrypoint script to handle XDC -> geth migration
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["--datadir", "/data"]