version: "3"

services:

  karmen_server:
    build: ../../../../
    ports:
      - 3000:3000
    environment:
      - DB_HOST=db
      - DB_PORT=3306
    ports:
      - 3000:3000
      
  db:
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - db:/var/lib/mysql
      - ./sql:/docker-entrypoint-initdb.d
    env_file:
      - db.env

  ldap_server:
    restart: always
    build: ./image
    command: --loglevel debug
    domainname: foo.org
    hostname: foo.org
    ports:
      - 389:389
    environment:
      - LDAP_ORGANISATION=Foo Organization
      - LDAP_DOMAIN=foo.org
      - LDAP_ADMIN_PASSWORD=admin

  ldap_web_client:
    restart: always
    image: osixia/phpldapadmin
    environment:
      - PHPLDAPADMIN_LDAP_HOSTS=ldap_server
      - PHPLDAPADMIN_HTTPS=false
    ports:
      - 3001:80
      
volumes:
  db:
