---

version: "3"

services:
  lumi2:
    build: .
    container_name: lumi2
    command: flask --app /app/lumi2 --debug run --host 0.0.0.0 --port 80
    volumes:
      - ./config.py/:/app/config.py:ro
      - ./lumi2/__init__.py:/app/lumi2/__init__.py:ro
      - ./lumi2/auth.py:/app/lumi2/auth.py:ro
      - ./lumi2/default_configuration.py:/app/lumi2/default_configuration.py:ro
      - ./lumi2/exceptions.py:/app/lumi2/exceptions.py:ro
      - ./lumi2/ldap.py:/app/lumi2/ldap.py:ro
      - ./lumi2/logging.py:/app/lumi2/logging.py:ro
      - ./lumi2/static/css:/app/lumi2/static/css:ro
      - ./lumi2/static/fonts:/app/lumi2/static/fonts:ro
      - ./lumi2/static/images/base:/app/lumi2/static/images/base:ro
      - ./lumi2/static/images/default:/app/lumi2/static/images/default:ro
      - ./lumi2/static/js:/app/lumi2/static/js:ro
      - ./lumi2/templates/:/app/lumi2/templates/:ro
      - ./lumi2/usermanager.py:/app/lumi2/usermanager.py:ro
      - ./lumi2/usermodel.py:/app/lumi2/usermodel.py:ro
      - ./lumi2/webapi.py:/app/lumi2/webapi.py:ro
      - ./tests/fakedata.py/:/app/tests/fakedata.py:ro
    environment:
      - LUMI_CONFIG=/app/config.py
    ports:
      - "8000:80"
    depends_on:
      - lumi2-openldap
  lumi2-openldap:
    container_name: lumi2-openldap
    image: osixia/openldap
    restart: unless-stopped
    volumes:
      - ./data/openldap/data:/var/lib/ldap
      - ./data/openldap/config:/etc/ldap/slapd.d
    hostname: openldap
    expose:
      - 389
    environment:
      LDAP_ORGANISATION: "Example Inc."
      LDAP_DOMAIN: "example.com"
      LDAP_ADMIN_PASSWORD: "admin"
      LDAP_CONFIG_PASSWORD: "admin"
      LDAP_TLS_VERIFY_CLIENT: "allow"
  lumi2-phpldapadmin:
    container_name: lumi2-phpldapadmin
    image: osixia/phpldapadmin
    restart: unless-stopped
    depends_on:
      - lumi2-openldap
    ports:
      - "8001:80"
    environment:
      PHPLDAPADMIN_LDAP_HOSTS: "openldap"
      PHPLDAPADMIN_HTTPS: "false"
      PHPLDAPADMIN_SERVER_ADMIN: "admin"

...
