version: '3.5'
services:
  ldap-account-manager:
    build:
      context: .
    image: ldapaccountmanager/lam:9.3
    restart: unless-stopped
    ports:
      - "8080:80"
    volumes:
      - lamconfig:/var/lib/ldap-account-manager/config
    environment:
      - LAM_PASSWORD=${LAM_PASSWORD}
      - LAM_LANG=en_US
      - LDAP_SERVER=${LDAP_SERVER}
      - LDAP_DOMAIN=${LDAP_DOMAIN}
      - LDAP_BASE_DN=${LDAP_BASE_DN}
      - LDAP_USER=cn=admin,${LDAP_BASE_DN}
      - DEBUG=true
    hostname: ldap-account-manager
  ldap:
    image: osixia/openldap:latest
    restart: unless-stopped
    environment:
      - LDAP_ORGANISATION=${LDAP_ORGANISATION}
      - LDAP_DOMAIN=${LDAP_DOMAIN}
      - LDAP_BASE_DN=${LDAP_BASE_DN}
      - LDAP_ADMIN_PASSWORD=${LDAP_ADMIN_PASSWORD}
      - LDAP_READONLY_USER=true
      - LDAP_READONLY_USER_PASSWORD=${LDAP_READONLY_USER_PASSWORD}
      - LDAP_TLS_CRT_FILENAME=ldap.crt
      - LDAP_TLS_KEY_FILENAME=ldap.key
      - LDAP_TLS_CA_CRT_FILENAME=ca.crt
      - LDAP_TLS_VERIFY_CLIENT=never

    command: "--loglevel info --copy-service"
    volumes:
      - ldap:/var/lib/ldap
      - slapd:/etc/ldap/slapd.d
      - ./certificates:/container/service/slapd/assets/certs
    hostname: ldap

volumes:
  lamconfig:
  ldap:
  slapd:

