GLPI Implementation in docker
503
This here, is a container running glpi with apache/php. If you want to have the full ecosystem of this project, have a look at the github repo here: GitHub Repo.
This repo proposes a method to run glpi using a container architecture, and explains some of the challenges and solutions of this process.
You can just run this as it is, with no file peristency and go through the setup process first time when you access the service from the browser.
Ex: docker container run -it --init --name glpi --hostname glpi --detach --publish 8080:80 routerology/glpi
If you want to have file persistency, there are a couple of advanced uses, that are documented in the reminder of this document and in the github repository of the project.
GLPI app has a couple of dependencies:
As hinted in the last requirement, we will have a multiprocess container that needs to run httpd and cron, and as you will see this container will be started with the "--init" option and a custom entrypoint script
I have included in the gitHub repo the following resources:
As said, we need a database for this glpi app to work, so an example of a database container is provided in the github repo, which is started with these credentials:
You can of course change this to whatever you like or even implement them as secrets.
We could provide a configured database config file, but I want a clean glpi instance withouth any preconfigured stuff,
so when you first start the container you will have to go through the glpi setup process
which will produce the db_config file.
Under startup-environment you have scripts to start individual containers: - start_glpi_persistent - start_glpi_nopersistent - start_mariadb
But you can do the same with compose scripts, also available under startup-environment: - compose_persist.yaml - compose_nopersist.yaml
The special goal of this project is to have a container that is easy to setup with persistency.
In order to have a custom directory layout we need to leverage two files: downstream.php and local_define.php.
The downstream.php file specifies the location of the config directory (in our case /etc/glpi), and needs to be placed under /var/www/glpi/inc/
The local_define.php file, specifies further the location of files and logs directories.
Having said that, we provide out of the box two custom downstream and local_define files in a temp location, and these two files will be copied in the
final location by the entrypoint script. We do this, in order to be able to populate any persistent runtime mounted storage (like /etc/glpi for example).
The GLPI app has a couple of requirements from the https/php server, and most of them have been already satisfied by the base layer image routerology/phpine,
but there is also a requirement regarding the DocumentRoot of the apache, which needs to be /var/www/glpi/public.
Having such a DocumentRoot, there needs to be some rewrite directives to direct request towards top folder /var/www/glpi,
and you will see that in the provided custom httpd.conf file:
Here is the directory structure I use with this container:
The container has an entrypoint script which does the following:
Content type
Image
Digest
sha256:12c58eb64…
Size
135.9 MB
Last updated
almost 2 years ago
docker pull routerology/glpi