Skip to content

Docker Container

Deon George edited this page Jan 8, 2024 · 4 revisions

Docker Image

PLA v2 is available on docker hub, you can find the image here.

NOTE: PHP v2 is still being developed, so the image on docker hub is a point in time of the development - it is not a fully functional release, but as development proceeds, its functionality will increase. When PLA v2 is ready, it will be available on docker hub with the latest release tag.

Running the image

  1. First pull the image with docker pull leenooks/phpldapadmin

  2. Create an encryption key with docker run -it --rm leenooks/phpldapadmin:2.0.0-dev ./artisan key:generate --show (you can ignore the OAUTH Encryption keys ERROR, that will be addressed in a later build.

    The output will look something like this:

    [deon@c-8-1 ldap]$ docker run -it --rm leenooks/phpldapadmin:2.0.0-dev ./artisan key:generate --show
    * Caching configuration...
    
       INFO  Caching the framework bootstrap files.
    
      config ................................................................................................................................. 10ms DONE
      routes ................................................................................................................................. 11ms DONE
    
    
       INFO  Blade templates cached successfully.
    
    * Generating OAUTH keys ...
    Encryption keys already exist. Use the --force option to overwrite them.
    * Starting NGINX...
    base64:3JrewY/3wdVdjKKQxfyh7Zn1gqBzLJfCL3JLfY4n1p4=
    

    In the above example, we'll need the base64:3JrewY/3wdVdjKKQxfyh7Zn1gqBzLJfCL3JLfY4n1p4= and that will be our APP_KEY environment variable.

  3. Start the container with the following environment variables:

    Variable Value Default Purpose
    APP_KEY (value from artisan key:generate) not defined This is used to encrypt data used internally. It should only need to be set once for the life of the application
    APP_TIMEZONE An applicable timezone UTC This is used to timezone used, mostly for, logging. eg: Australia/Melbourne
    APP_URL http[s]://URL not defined The URL used to get to your PLA instance, eg: https://demo.phpldapadmin.org
    LDAP_CACHE true false We use internal caching to reduce the impact to your LDAP server, this enables that caching
    LDAP_HOST hostname to your LDAP server not defined A resolvable hostname to your LDAP server
    CACHE_DRIVER preferred caching driver file You can use memcached here, memcached is included in the image
    MEMCACHED_START TRUE or FALSE [undefined] (false) Whether to start memcached when the container starts. You'll need to set this to true, if your CACHE_DRIVER is set to memcached

    There are other variables you can set - they are listed Configuration Variables.

  4. Include the relevant port mapping (docker's -p option, eg: -p 80:80. The internal nginx server will accept requests on port 80. You can run a proxy in front of PLA, if you want to provide https access to PLA (the PLA demo uses nginx in front of the container).

  5. You might to add some persistent mounts, so that user sessions and logging survives container restarts. You can add these 2 mounts as appropriate:

    Container Path Purpose
    /var/www/html/storage/framework/sessions Maintains a user's session
    /var/www/html/storage/logs Debug log
  6. Once your container is running, point your browser at the url/port and you should be good to go

NOTE: PLA assumes it can query your LDAP server using an anonymous bind to get schema information and to find users via an LDAP query to use the DN for authentication. If you are using mail (email) address to login, it is assumed that the email values can be found via an anonymous bind query.

Clone this wiki locally