version: '2'

services:
    warpinfra-app:
        build: ./www/
        ports:
            - 8000:80
            - 8001:443
            - 8080:8080
        volumes:
            - ./www/web:/opt/warpinfra
            - ./www/nginx:/opt/nginx
            - ./www/conf/config.ini:/etc/warpinfra/config.ini
            - ./www/web/warpzone.db:/opt/database/warpzone.db
        entrypoint: /opt/entrypoint_dev.sh
        depends_on:
            - ldap
            - mysql
        links:
            - ldap
            - mysql

    mysql:
        image: mariadb:latest
        environment:
            - "MYSQL_DATABASE=warpinfra"
            - "MYSQL_USER=warpinfra"
            - "MYSQL_PASSWORD=3HJJfad232sTGeKEex"
            - "MYSQL_ROOT_PASSWORD=toor"

    ldap:
        image: osixia/openldap:latest
        hostname: ldap-service
        environment:
            - "LDAP_ORGANISATION=Warpzone"
            - "LDAP_DOMAIN=warpzone.ms"
            - "LDAP_ADMIN_PASSWORD=k7dAw8j2"
        volumes:
            - /opt/warpzone/ldap/database:/var/lib/ldap
            - /opt/warpzone/ldap/config:/etc/ldap/slapd.d

    ldapadmin:
        image: osixia/phpldapadmin:latest
        hostname: phpldapadmin-service
        ports:
            - 6443:443
        environment:
            - "PHPLDAPADMIN_LDAP_HOSTS=ldap"
        depends_on:
            - ldap
        links:
            - ldap
