FROM freeradius/freeradius-server:3.0.20

RUN apt-get update \
    && apt-get install -y patch \
    && rm -rf /var/lib/apt/lists/*

COPY default.patch inner-tunnel.patch ./

RUN echo "Patching site config files to use LDAP module" \
    && patch /etc/raddb/sites-available/default default.patch \
    && patch /etc/raddb/sites-available/inner-tunnel inner-tunnel.patch

COPY eap /etc/raddb/mods-enabled/
