services: openldap: image: osixia/openldap:1.5.0 container_name: ${LDAP_CONTAINER_NAME:-ldap-server} hostname: ${LDAP_HOSTNAME:-ldap.testing.local} environment: # Base domain configuration LDAP_ORGANISATION: ${LDAP_ORGANISATION:-Testing Organization} LDAP_DOMAIN: ${LDAP_DOMAIN:-testing.local} LDAP_BASE_DN: ${LDAP_BASE_DN:-dc=testing,dc=local} # Admin credentials (change these for production) LDAP_ADMIN_PASSWORD: ${LDAP_ADMIN_PASSWORD:-admin_password} LDAP_CONFIG_PASSWORD: ${LDAP_CONFIG_PASSWORD:-config_password} # SSL/TLS Configuration LDAP_TLS: ${LDAP_TLS:-true} LDAP_TLS_CRT_FILENAME: ${LDAP_TLS_CRT_FILENAME:-server.crt} LDAP_TLS_KEY_FILENAME: ${LDAP_TLS_KEY_FILENAME:-server.key} LDAP_TLS_CA_CRT_FILENAME: ${LDAP_TLS_CA_CRT_FILENAME:-ca.crt} LDAP_TLS_VERIFY_CLIENT: ${LDAP_TLS_VERIFY_CLIENT:-try} # Logging LDAP_LOG_LEVEL: ${LDAP_LOG_LEVEL:-256} ports: # Standard LDAP port - "${LDAP_PORT:-389}:389" # LDAPS (SSL) port - "${LDAPS_PORT:-636}:636" volumes: # Custom certificates - place your dev-ca certs here - ./certs:/container/service/slapd/assets/certs:ro # LDIF files for initial data population - ./ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom:ro # Persistent data storage - ldap_data:/var/lib/ldap - ldap_config:/etc/ldap/slapd.d networks: - ldap-network restart: unless-stopped command: --copy-service --loglevel debug # Optional: phpLDAPadmin for web-based management phpldapadmin: image: osixia/phpldapadmin:0.9.0 container_name: ${PHPLDAPADMIN_CONTAINER_NAME:-ldap-admin} environment: PHPLDAPADMIN_LDAP_HOSTS: "openldap" PHPLDAPADMIN_HTTPS: "false" ports: - "${PHPLDAPADMIN_PORT:-8080}:80" depends_on: - openldap networks: - ldap-network restart: unless-stopped volumes: ldap_data: driver: local ldap_config: driver: local networks: ldap-network: driver: bridge