ungleich-user/dev/ldap/Dockerfile
Sajeyks 692c1b1657 Add local OpenLDAP 2.6 test server for development
Alpine 3.24 based slapd with the production directory layout
(dc=ungleich,dc=ch, ou=customers, ou=users) and the openssh-lpk schema.
The app runs natively against it on ldap://localhost:3389.
Includes dev/env.dev with dev-only settings (cp dev/env.dev .env).
2026-11-06 14:46:24 +03:00

23 lines
839 B
Docker

# 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 \
&& 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
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"]