FROM docker.io/library/debian:bookworm-slim

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

WORKDIR /app
RUN git clone --depth 1 https://github.com/OpenEtherCATSociety/SOES.git /app/soes

COPY soes_daemon.c /app/soes_daemon.c

RUN gcc -O2 -I/app/soes/soes -I/app/soes/soes/hal/linux /app/soes_daemon.c -o /app/soes_daemon

EXPOSE 10885

CMD ["/app/soes_daemon"]
