LostFocus

Hi, I'm Dominik Schwind, friend of the internet. Here is /now.
Say hello to me on Twitter or maybe even subscribe to my weekly newsletter.

March 26, 2018

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.