Git Product home page Git Product logo

docker-glpi's Introduction

Docker GLPI

Build Status

This images contains an instance of GLPI web application served by nginx and php5-fpm on port 80

โš ๏ธ Take care of the changelogs because some breaking changes may happen between versions.

Supported tags, image variants and respective Dockerfile links

  • nginx and PHP7.2 embedded Dockerfile

    • nginx-72-9.5.5-latest, nginx-72-latest
    • nginx-72-9.5.4-latest, nginx-72-latest

Docker Informations

  • This image expose the following ports
Port Usage
80/tcp HTTP web application

see https part to known about ssl

  • This image takes theses environnements variables as parameters
Environment Type Usage
TZ String Contains the timezone
GLPI_REMOVE_INSTALLER Boolean (yes/no) Set to yes if it's not the first installation of glpi
GLPI_CHMOD_PATHS_FILES Boolean (yes/no) Set to yes to apply chmod/chown on /var/www/files (useful for host mount)
GLPI_INSTALL_PLUGINS String Comma separated list of plugins to install (see below)
PHP_MEMORY_LIMIT String see PHP memory_limit configuration
PHPFPM_PM String see PHPFPM pm configuration
PHPFPM_PM_MAX_CHILDREN Integer see PHPFPM pm.max_children configuration
PHPFPM_PM_START_SERVERS Integer see PHPFPM pm.start_servers configuration
PHPFPM_PM_MIN_SPARE_SERVERS Integer see PHPFPM pm.min_spare_servers configuration
PHPFPM_PM_MAX_SPARE_SERVERS Integer see PHPFPM pm.max_spare_servers configuration
PHPFPM_PM_PROCESS_IDLE_TIMEOUT Mixed see PHPFPM pm.process_idle_timeout configuration
PHPFPM_PM_MAX_REQUEST Integer see PHPFPM pm.max_request configuration

The GLPI_INSTALL_PLUGINS variable must contains the list of plugins to install (download and extract) before starting glpi. This environment variable is a comma separated list of plugins definitions. Each plugin definition must be like this "PLUGINNAME|URL". The PLUGINNAME is the name of the first folder in plugin archive and will be the glpi's name of the plugin. The URL is the full URL from which to download the plugin. This url can contains some compressed file extensions, in some case the installer script will not be able to extract it, so you can create an issue with specifying the unhandled file extension. These two items are separated by a pipe symbol.

To summarize, the GLPI_INSTALL_PLUGINS variable must follow the following skeleton GLPI_INSTALL_PLUGINS="name1|url1,name2|url2" For better example see at the end of this file.

  • The following volumes are exposed by this image
Volume Usage
/var/www/files The data path of GLPI
/var/www/config The configuration path of GLPI

Application Informations

HTTPS - SSL encryption

There are many different possibilities to introduce encryption depending on your setup.

As most of available docker image on the internet, I recommend using a reverse proxy in front of this image. This prevent me to introduce all ssl configurations parameters and also to prevent a limitation of the available parameters.

For example, you can use the popular nginx-proxy and docker-letsencrypt-nginx-proxy-companion containers or Traefik to handle this.

GLPI Cronjob

GLPI require a job to be run periodically. Starting from 3.0.0 release, this image does not provide any solution to handle this. I've choose to remove cron task from this image to respect docker convention and to prevent a clustered deploiement to run the cron on all cluster instances.

As compensation I provide a wrapper script that wrap the batch execution and return a json object with job execution details at /opt/scripts/cronwrapper.py

To ensure correct GLPI running please put this job in your common cron scheduler. On linux you can use the /etc/crontab file with a content similar to this one :

*/15 * * * * root docker ps | grep --quiet 'glpi' && docker exec --user www-data glpi /opt/scripts/cronwrapper.py --forward-stderr

Timezone issues

Timezone is handled at PHP level in the image since 2.4.2 version, but you might encounter issues if you use different timezone in your database engine. Please refer to the GLPI documentations to handle this at database level https://glpi-install.readthedocs.io/en/develop/timezones.html.

Todo

Installation

docker pull turgon37/glpi:nginx-72-latest

Usage

The first time you run this image, set the GLPI_REMOVE_INSTALLER variable to 'no', then after this first installation set it to 'yes' to remove the installer.

Without database link (you can use an ip address or a domain name in the installer gui)

docker run --name glpi --publish 8000:80 --volume data-glpi:/var/www/files --volume data-glpi-config:/var/www/config turgon37/glpi:nginx-56-latest

With database link (if you have any MySQL/MariaDB as a docker container)

Create dedicated network

docker network create glpi-network

Start a MySQL instance

docker run --name mysql -d --net glpi-network -e MYSQL_DATABASE=glpi -e MYSQL_USER=glpi -e MYSQL_PASSWORD=glpi -e MYSQL_ROOT_PASSWORD=root_password mysql

Start a GLPI instance

docker run --name glpi --publish 8000:80 --volume data-glpi:/var/www/files --volume data-glpi-config:/var/www/config --net glpi-network turgon37/glpi:nginx-56-latest

Docker-compose Specific configuration examples

  • Production configuration with already installed GLPI with FusionInventory and dashboard plugin :
version: '2.1'
services:

  glpi:
    image: turgon37/glpi:nginx-72-latest
    environment:
      GLPI_REMOVE_INSTALLER: 'no'
      GLPI_INSTALL_PLUGINS: "
        fusioninventory|https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi9.4%2B2.4/fusioninventory-9.4+2.4.tar.bz2,\
        dumpentity|https://forge.glpi-project.org/attachments/download/2089/glpi-dumpentity-1.4.0.tar.gz\
        "
    ports:
      - 127.0.0.1:8008:80
    volumes:
      - data-glpi-files:/var/www/files
      - data-glpi-config:/var/www/config
    depends_on:
      mysqldb:
        condition: service_healthy
    restart: always
    networks:
      glpi-network:
        aliases:
          - glpi

  mysqldb:
    image: mysql
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: always
    command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - mysql-glpi-db:/var/lib/mysql
    restart: always
    networks:
      glpi-network:
        aliases:
          - mysqldb

networks:
  glpi-network:
    driver: bridge

volumes:
  data-glpi-files:
  data-glpi-config:
  mysql-glpi-db:

docker-glpi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-glpi's Issues

alert Glpi cron

when i go into fusioninventory i got an alert "GLPI cron is not running, see documentation" that can do something to fix it ???

Enforce apache user

Enforce apache user is the owner of the mountable volumes, once you mount /var/www/files for example it gave me the error below for the installation:

image
Command to reproduce:

docker run -d --restart=unless-stopped -v /volumes/glpi/data:/var/www/files -p [::1]:8680:80 turgon37/glpi

If you wan't i can help you with the issues that i'm opening.

Bump Version

Please bump the version to GLPI 9.2.1 and create one new image at docker hub.

Thanks.

Timezone in the glpi container

The container is currently set permanently UTC timezone, which generates problems, for example: with Fusioninventory, tasks and agents.
The settings in php.ini are skipped, GLPI still shows the UTC time.
It should be possible to configure this at the stage of the container installation.
For example, with the default settings from the host.
workaround:

docker exec -it glpi /bin/sh -c "apk add --no-cache tzdata"
docker exec -it glpi /bin/sh -c "export TZ='Europe/Warsaw'"
docker exec -it glpi /bin/sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone"

issue in new nginx56 version - permission

Past update from old version:
Not write permission for www-data user in:
/var/www/files/*
/var/www/config/config_db.php
(old user id 101)

Permision to write for www-data user for other glpi application file and directory in /war/www/*

Time and timezone in mariaDB container affect some logs or action log time

If mariadb container have another time/timezone then example here /front/crontask.php will be last run time from mariaDB.
https://glpi-install.readthedocs.io/en/develop/timezones.html

short workaround:

ocker exec -it mariadb /bin/sh -c "export TZ='Europe/Warsaw'"
docker exec -it mariadb /bin/sh -c "rm /etc/localtime"
docker exec -it mariadb /bin/sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone"

upgrade to 9.5.1

When I go to update I get the following renown:

updating software tables. This may take several minutes.

Rename "AuthLdap" itemtype to "AuthLDAP"
Rename "Crontask" itemtype to "CronTask"
Rename "InfoCom" itemtype to "Infocom"

where are those items, are the bd or are they files ??? I do not understand

Nginx variables for big production environment

    # Timeout for keep-alive connections. Server will close connections after
    # this time.
    keepalive_timeout 600;
    proxy_connect_timeout  600;
    proxy_send_timeout  600;
    proxy_read_timeout  600;
    fastcgi_send_timeout 600;
    fastcgi_read_timeout 600;

GLPI version and compose Tag

Hi,

using "image: turgon37/glpi:nginx-72-9.5.3-latest" in compose file gives me a manifest error
using "image: turgon37/glpi:nginx-72-latest" will setup glpi 9.5.1
using "image: turgon37/glpi" will setup glpi 9.3.3

Is your image up to date on docker hub?

https in glpi

Good, can it be configured to use port 443 with https certificate ??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.