Need an extra feature? Found a problem? Raise an issue on Github!
GLPI is an open-source CMDB tool, an asset and helpdesk management solution.
This Docker image has been created in accordance with GLPI official documentation.
- PHP (version <= 8.3) with mandatory extensions (for this purpose docker-php-extension-installer is used);
- Nginx web server;
- MariaDB database engine (version => 10.2, can be external).
This Docker image is based on PHP-fpm image, which is built on Debian 12.
There are 3 main services running inside the container:
- Supervisord - monitors and controls the rest 2 processes;
- PHP-fpm (version = 8.3);
- Nginx (SSL encryption is configured as mandatory).
Note: self-signed certificate for webserver is provided by default, if not defined otherwise and the domain certificate is not provided.
Important: database engine is not included in this Docker image itself, but is mandatory for running GLPI - no matter where it is running, in Docker or directly on the host machine - and is included in this bundle. Learn more below.
Note: make sure that make tool is installed on your system to be able to execute the mentioned below commands:
#!/bin/bash
#Debian syntax
apt update -y && apt install -y build-essentialTo start using GLPI in Docker:
- run the suggested below command;
- open GLPI in web browser;
- log in;
- start using GLPI and deploy GLPI agents to your IT assets.
Note: the DNS name or IP address of GLPI web page, as well as credentials and database parameters are defined in .ENV file.
Important: note that if NEW_INSTANCE=true in .ENV file, then application files and database schema will be overwritten and reconfigured from scratch.
Running GLPI in Docker with persistent data in volumes:
#!/bin/bash
#git clone https://github.com/alyonamoskalets/Docker_GLPI
make upSetting up domain SSL certificates:
Place both certificate and private key to the specific location on the host. The default one is:
/apps/glpi/sslIn order to perform an upgrade of GLPI version to the newer one, execute this command:
#!/bin/bash
#git clone https://github.com/alyonamoskalets/Docker_GLPI
make upgradeWarning: set NEW_INSTANCE and SSL_AUTO_GENERATE to false in .ENV file before go further!
It is possible to migrate your current GLPI instance, running on some host machine directly, into the Docker container by performing the mentioned below sequence of operations.
Note: the following notation will be used for convience:
$SOURCE = the host machine, where current GLPI instance and its database are running.
$TARGET = the host machine with Docker engine running.
- Identify current versions on $SOURCE:
- PHP;
- MySQL/MariaDB database engine;
- GLPI files (it can be done through its web page).
-
Perform migration:
2.0. choose the correct file structure on $TARGET by modifying docker-compose.yml file;
2.1. copy GLPI files from $SOURCE to $TARGET;
2.2. copy SSL certificates from $SOURCE to $TARGET;
2.3. create a dump of GLPI database on $SOURCE under root database user and copy it to $TARGET:
#!/bin/bash mysqldump -u root -pYourOldPassword oldDatabaseName > /path/to/glpi_backup.sql
2.4. run MariaDB database in Docker container on $TARGET:
#!/bin/bash #git clone https://github.com/alyonamoskalets/Docker_GLPI make up
2.5. restore the dump on $TARGET:
#!/bin/bash docker exec mariadb mariadb -u root -pglpi glpi < /path/to/glpi_backup.sql
or (if the first one does not work properly):
#!/bin/bash cat /path/to/glpi_backup.sql | docker exec -i mariadb mariadb -u root -pglpi glpi
2.6. Perform GLPI upgrade operation:
#!/bin/bash #git clone https://github.com/alyonamoskalets/Docker_GLPI make upgrade
2.7. You must be done with GLPI migration!
The following list of quick commands can be used to help you automate and speed up the GLPI deployment:
#!/bin/bash
#git clone https://github.com/alyonamoskalets/Docker_GLPI
make up #starts bundle of GLPI and MariaDB
make down #stops and removes bundle
make restart #restarts bundle
make upgrade #performs GLPI upgrade operation.
├── /etc/
│ ├── /nginx/
│ │ ├── nginx.conf
│ │ └── /conf.d/
│ │ ├── nginx_https.conf
│ │ └── nginx_http.conf
│ ├── /ssl/
│ │ └── /mycerts/
│ │ ├── ${SERVER_NAME}.crt
│ │ ├── ${SERVER_NAME}.key
│ │ └── ${SERVER_NAME}.csr
│ └── /supervisor/
│ └── /conf.d/
│ └── supervisord.conf
├── /scripts/
│ ├── *.sh
│ ├── my.env
│ └── colors.env
├── /usr/
│ ├── /bin/
│ │ └── supervisord
│ ├── /local/
│ │ ├── /etc/
│ │ │ └── /php/
│ │ │ ├── php.ini
│ │ │ └── *.*
│ │ └── /sbin/
│ │ └── php-fpm
│ └── /sbin/
│ └── nginx
└── /var/
├── /www/
│ └── /glpi/
│ ├── /files/
│ │ ├── /config/
│ │ │ ├── config_db.php
│ │ │ └── *.*
│ │ └── *.*
│ └── *.*
└── /log/
└── /glpi/
└── *.*