FROM alpine:3.20

EXPOSE 67/udp
EXPOSE 69/udp
EXPOSE 80/tcp

ENTRYPOINT ["/usr/sbin/initial-config.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

WORKDIR /srv/s

RUN apk add --no-cache \
    busybox-extras \
    supervisor \
    syslinux \
    tftp-hpa

RUN touch /var/lib/udhcpd/udhcpd.leases && \
  mv /usr/share/syslinux/* /srv

COPY configs/deploy-initial-config.sh /usr/sbin/initial-config.sh
COPY configs/deploy-supervisord.conf /etc/supervisord.conf
COPY configs/udhcpd-sample.conf /etc/udhcpd.conf
COPY configs/pxelinux.cfg /srv/pxelinux.cfg/default