# Minimal, self-contained OpenLDAP test directory (Debian + slapd).
# Presents the posixAccount/posixGroup/inetOrgPerson schema the LDAP Authentication
# OpenLDAP submodule expects (gidNumber-based group membership, entryUUID guid).
FROM debian:12-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y --no-install-recommends slapd ldap-utils openssl ca-certificates procps \
    && rm -rf /var/lib/apt/lists/*

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY bin/dirctl /usr/local/bin/dirctl
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/dirctl

EXPOSE 389 636

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
