Just for future reference, this is the docker-compose.yml
that works for me to have a working-ish OpenLDAP docker container with phpLDAPAdmin:
version: '2'
services:
openldap:
image: osixia/openldap
command: --copy-service
volumes:
- config:/etc/ldap/slapd.d
- database:/var/lib/ldap
phpldapadmin:
image: osixia/phpldapadmin
environment:
PHPLDAPADMIN_LDAP_HOSTS: openldap
links:
- openldap
depends_on:
- openldap
ports:
- 6443:443
volumes:
config:
database:
It took me quite a while to figure out how to persist the data – mostly because both OpenLDAP and Docker are new to me – and it turns out – command: --copy-service
and importantly - config:/etc/ldap/slapd.d
do the trick.