version: "3.8"

services:

  openldap:
    image: bitnami/openldap:2.6
    ports:
    - "389:389"
    - "636:636"
    volumes:
    - ./data:/bitnami/openldap
    environment:
    - LDAP_PORT_NUMBER=389
    - LDAP_ROOT=dc=example,dc=org
    - LDAP_ADMIN_USERNAME=admin
    - LDAP_ADMIN_PASSWORD=admin
    - LDAP_USERS=customuser
    - LDAP_PASSWORDS=custompassword
    - LDAP_ADMIN_DN=cn=admin,dc=example,dc=org
    - LDAP_ENABLE_TLS=yes
    - LDAP_REQUIRE_TLS=yes
    - LDAP_LDAPS_PORT_NUMBER=636
    - LDAP_TLS_CERT_FILE=/bitnami/openldap/certs/ldap.crt
    - LDAP_TLS_KEY_FILE=/bitnami/openldap/certs/ldap.key
    - LDAP_TLS_CA_FILE=/bitnami/openldap/certs/ca.crt
  restart: unless-stopped
