Skip to content

Latest commit

 

History

History
327 lines (232 loc) · 11.6 KB

README.md

File metadata and controls

327 lines (232 loc) · 11.6 KB

docker-glpi-standalone

This fork is intended only to provide method to deploy glpi on air gap network. The official method does not permit to run the docker on air gap network as it try to download within the container the GLPI source.

It also help to fix the permissions issue between the container and the host by defining new UID/GID to www-data user/group so that it match a defined UID/GID on your host.

I decided to use 40000 as UID/GID as it is not common.

In addition, it add support to deploy GLPI in a subfolder.

Credits

Project to deploy GLPI with docker

Docker Pulls Docker Stars Docker Cloud Automated build

Table of Contents

Introduction

Install and run an GLPI instance with docker

Default accounts

More info in the 📄Docs

Login/Password Role
glpi/glpi admin account
tech/tech technical account
normal/normal "normal" account
post-only/postonly post-only account

Deploy with CLI

Deploy GLPI

docker run --name mariadb -e MARIADB_ROOT_PASSWORD=diouxx -e MARIADB_DATABASE=glpidb -e MARIADB_USER=glpi_user -e MARIADB_PASSWORD=glpi -d mariadb:10.7
docker run --name glpi --link mariadb:mariadb -p 80:80 -d zx900930/glpi-standalone

Deploy GLPI with existing database

docker run --name glpi --link yourdatabase:mariadb -p 80:80 -d zx900930/glpi-standalone

Deploy GLPI with database and persistence data

For an usage on production environnement or daily usage, it's recommanded to use container with volumes to persistent data.

  • First, create MariaDB container with volume
docker run --name mariadb -e MARIADB_ROOT_PASSWORD=diouxx -e MARIADB_DATABASE=glpidb -e MARIADB_USER=glpi_user -e MARIADB_PASSWORD=glpi --volume /var/lib/mysql:/var/lib/mysql -d mariadb:10.7
  • Then, create GLPI container with volume and link MariaDB container
docker run --name glpi --link mariadb:mariadb --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 -d zx900930/glpi-standalone

Enjoy :)

Deploy a specific release of GLPI

Default, docker run will use the latest release of GLPI. For an usage on production environnement, it's recommanded to set specific release. Here an example for release 9.1.6 :

docker run --name glpi --hostname glpi --link mariadb:mariadb --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 --env "VERSION_GLPI=9.1.6" -d zx900930/glpi-standalone

Deploy with docker-compose

Deploy without persistence data ( for quickly test )

version: "3.8"

services:
#MariaDB Container
  mariadb:
    image: mariadb:10.7
    container_name: mariadb
    hostname: mariadb
    environment:
      - MARIADB_ROOT_PASSWORD=password
      - MARIADB_DATABASE=glpidb
      - MARIADB_USER=glpi_user
      - MARIADB_PASSWORD=glpi

#GLPI Container
  glpi:
    image: triatk/glpi-standalone
    container_name : glpi
    hostname: glpi
    ports:
      - "80:80"

Deploy a specific release

version: "3.8"

services:
#MariaDB Container
  mariadb:
    image: mariadb:10.7
    container_name: mariadb
    hostname: mariadb
    environment:
      - MARIADB_ROOT_PASSWORD=password
      - MARIADB_DATABASE=glpidb
      - MARIADB_USER=glpi_user
      - MARIADB_PASSWORD=glpi

#GLPI Container
  glpi:
    image: triatk/glpi-standalone
    container_name : glpi
    hostname: glpi
    environment:
      - VERSION_GLPI=9.5.6
    ports:
      - "80:80"

Deploy with persistence data

To deploy with docker compose, you use docker-compose.yml and mariadb.env file. You can modify mariadb.env to personalize settings like :

  • MariaDB root password
  • GLPI database
  • GLPI user database
  • GLPI user password

mariadb.env

MARIADB_ROOT_PASSWORD=diouxx
MARIADB_DATABASE=glpidb
MARIADB_USER=glpi_user
MARIADB_PASSWORD=glpi

docker-compose .yml

version: "3.2"

services:
  #MariaDB Container
  mariadb:
    image: mariadb:10.7
    container_name: mariadb
    hostname: mariadb
    volumes:
      - /var/lib/mysql:/var/lib/mysql
    env_file:
      - ./mariadb.env
    restart: always

  #GLPI Container
  glpi:
    image: triatk/glpi-standalone
    container_name: glpi
    hostname: glpi
    ports:
      - "80:80"
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /var/www/html/glpi/:/var/www/html/glpi
      #- /opt/glpi/plugins/:/plugins # you can install your own plugins by mount the plugins directory and modify the env INSTALL_PLUGINS to true.
      #- /opt/glpi/backup_glpi/:/backup_glpi # you can persist the backup data by mounting a backup folder.
    environment:
      - TIMEZONE=Europe/Brussels
      #- GLPI_ALIAS=glpi  # Optional, uncomment to deploy GLPI in a subfolder, default subdir is /glpi
      - VERSION_GLPI=10.0.16  # Optional, default to 10.0.16
      - VERSION_PHP=8.3  # Optional, default to 8.3
      - INSTALL_PLUGINS=false  # Optional, default to false
      - OPCACHE_SIZE=128  # Optional, default to 128
      - OPCACHE_BUFFER=8  # Optional, default to 8
      - OPCACHE_WASTED_PERCENTAGE=5  # Optional, default to 5
      - GLPI_UPGRADE_MIGRATION=false  # Optional, default to false
    restart: always

To deploy, just run the following command on the same directory as files

docker-compose up -d

Environnment variables

TIMEZONE

If you need to set timezone for Apache and PHP

From commande line

docker run --name glpi --hostname glpi --link mariadb:mariadb --volumes-from glpi-data -p 80:80 --env "TIMEZONE=Europe/Brussels" -d zx900930/glpi-standalone

From docker-compose

Modify this settings

environment:
     TIMEZONE=Europe/Brussels

GLPI_ALIAS

If you need to deploy GLPI in a subfolder

Modify this variable in the docker compose file

environment:
      #- GLPI_ALIAS=glpi  # Optional, uncomment to deploy GLPI in a subfolder, default subdir is /glpi

INSTALL_PLUGINS

If you need to install plugins from ./plugins folder to GLPI

Modify this variable in the docker compose file

environment:
      - INSTALL_PLUGINS=false  # Optional, default to false

VERSION_GLPI

If you need to deploy a different GLPI version

Modify this variable in the docker compose file

environment:
      - VERSION_GLPI=10.0.15  # Optional, default to 10.0.15

VERSION_PHP

If you need to deploy a different PHP version

Modify this variable in the docker compose file

environment:
      - VERSION_PHP=8.3  # Optional, default to 8.3

GLPI_UPGRADE_MIGRATION

If you upgrade the glpi version and need to do a database migration

Modify this variable in the docker compose file, remember to change the value back to false once the migration was done!!

environment:
      - GLPI_UPGRADE_MIGRATION=true  # Optional, default to false