ungleich-user/dev/ldap/Dockerfile

24 lines
861 B
Text
Raw Permalink Normal View History

# Local OpenLDAP for development and tests only. Not for production.
#
# Alpine 3.24 ships OpenLDAP 2.6.15. No sshd is installed here; the
# "openssh-lpk" bit below is only an LDAP schema for the ldapPublicKey
# objectClass that the app writes.
FROM alpine:3.24
RUN apk add --no-cache \
openldap \
openldap-back-mdb \
openldap-clients \
openssl \
&& mkdir -p /run/openldap /var/lib/openldap/openldap-data /etc/openldap/slapd.d \
&& rm -rf /etc/openldap/slapd.conf /etc/openldap/slapd.ldif
COPY config.ldif openssh-lpk.ldif seed.ldif /bootstrap/
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 389 636
HEALTHCHECK --interval=5s --timeout=3s --retries=10 \
CMD ldapsearch -x -H ldap://localhost -b "" -s base namingContexts | grep -q "dc=ungleich,dc=ch" || exit 1
ENTRYPOINT ["/entrypoint.sh"]