FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

# Install Zenoh
RUN apt-get update && \
    apt-get install -y curl gnupg && \
    echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" > /etc/apt/sources.list.d/zenoh.list && \
    apt-get update && \
    apt-get install -y zenohd zenoh-plugin-remote-api && \
    rm -rf /var/lib/apt/lists/*

# Create config directory
RUN mkdir -p /etc/zenoh

# Copy config template
COPY config.json5 /etc/zenoh/config.json5

EXPOSE 7887/tcp 7887/udp 443

CMD ["/usr/bin/zenohd", "-c", "/etc/zenoh/config.json5"]
