Skip to content

Docker Container

Deon George edited this page Jan 12, 2025 · 5 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. You can optionally (and recommended) choose to pass an encryption key to the container, which is used to encrypt Cookies and other items during your session with PLA. If you want to persist your encryption key, then you should perform this step.

    If you dont create an encryption key, one will be created for each time the container starts.

    Creating a key is simple, using docker run -it --rm leenooks/phpldapadmin:2.0.0-dev ./artisan key:generate --show

    The output will look something like this:

    * Started with [./artisan key:generate --show]
    * Laravel Setup...
      + Encryption Key auto created, replace with with "artisan key:generate --force"
    
       INFO  Application key set successfully.
    
      - Caching configuration...
    
       INFO  Caching framework bootstrap, configuration, and metadata.
    
      config .................................................................................................................. 17.38ms DONE
      events ................................................................................................................... 0.70ms DONE
      routes .................................................................................................................. 12.14ms DONE
      views ................................................................................................................... 68.91ms DONE
    
    base64:3JrewY/3wdVdjKKQxfyh7Zn1gqBzLJfCL3JLfY4n1p4=
    

    In the above example, we'll need the base64:3JrewY/3wdVdjKKQxfyh7Zn1gqBzLJfCL3JLfY4n1p4= and that should be used with your APP_KEY environment variable.

  3. You can tune the container with the following environment variables:

    Variable Value Default Purpose
    APP_KEY (value from artisan key:generate --show) [auto created] This is used to encrypt data used internally. It is recommended to create your persistent key using the steps above.
    APP_TIMEZONE An applicable timezone UTC This is used to timezone used, mostly for, logging. eg: Australia/Melbourne
    APP_URL http[s]://URL [undefined] 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/IP address [undefined] A resolvable hostname or IP address to your LDAP server. PLA will connect to this server (over TCPIP, thus remotely).
    CACHE_DRIVER preferred caching driver file You can use memcached here. If you use memcached, then you'll need to start a another container, and provide the connection information to it (see below)
    MEMCACHED_HOST hostname/IP address [undefined] If you use memcached for CACHE_DRIVER, this is the hostname/IP address to connect to the remote memcached instance.
    MEMCACHED_PORT tcp port 11211 If you use memcached for CACHE_DRIVER, this is the port used to connect to memcached.
    SERVER_NAME ip address/port :8080 Use this to control the port that frankenphp access connections inside the container.

    (*) Required

    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:8080. frankenphp is by default running as non-root and will accept requests on port 8080. You can run a proxy in front of PLA, if you want to provide https access to PLA and terminate your HTTPS connections externally (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 (you define in the port mapping above) 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