You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docker-glpi/README.md

93 lines
3.1 KiB

# Project to deploy GLPI with docker
[![](https://images.microbadger.com/badges/version/diouxx/glpi.svg)](http://microbadger.com/images/diouxx/glpi "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/diouxx/glpi.svg)](http://microbadger.com/images/diouxx/glpi "Get your own image badge on microbadger.com")
# Table of Contents
- [Project to deploy GLPI with docker](#project-to-deploy-glpi-with-docker)
- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [Deploy with CLI](#deploy-with-cli)
- [Deploy GLPI](#deploy-glpi)
- [Deploy GLPI with existing database](#deploy-glpi-with-existing-database)
- [Deploy GLPI with database and persistance container data](#deploy-glpi-with-database-and-persistance-container-data)
- [Deploy a specific release of GLPI](#deploy-a-specific-release-of-glpi)
- [Deploy with docker-compose](#deploy-with-docker-compose)
- [Environnment variables](#environnment-variables)
- [TIMEZONE](#timezone)
# Introduction
Install and run an GLPI instance with docker.
# Deploy with CLI
## Deploy GLPI
```sh
docker run --name mysql -e MYSQL_ROOT_PASSWORD=diouxx -e MYSQL_DATABASE=glpidb -e MYSQL_USER=glpi_user -e MYSQL_PASSWORD=glpi -d mysql:5.7.23
docker run --name glpi --link mysql:mysql -p 80:80 -d diouxx/glpi
```
## Deploy GLPI with existing database
```sh
docker run --name glpi --link yourdatabase:mysql -p 80:80 -d diouxx/glpi
```
## Deploy GLPI with database and persistance container data
For an usage on production environnement or daily usage, it's recommanded to use a data container for persistent data.
* First, create MySQL container with volume
```sh
docker run --name mysql -e MYSQL_ROOT_PASSWORD=diouxx -e MYSQL_DATABASE=glpidb -e MYSQL_USER=glpi_user -e MYSQL_PASSWORD=glpi --volume /var/lib/mysql:/var/lib/mysql -d mysql:5.7.23
```
* Then, create GLPI container with volume and link MySQL container
```sh
docker run --name glpi --link mysql:mysql --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 -d diouxx/glpi
```
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 use the latest release.
Here an example for release 9.1.6 :
```sh
docker run --name glpi --hostname glpi --link mysql:mysql --volume /var/www/html/glpi:/var/www/html/glpi -p 80:80 --env "VERSION_GLPI=9.1.6" -d diouxx/glpi
```
# Deploy with docker-compose
To deploy with docker compose, you use *docker-compose.yml* and *mysql.env* file.
You can modify **_mysql.env_** to personalize settings like :
* MySQL root password
* GLPI database
* GLPI user database
* GLPI user password
To deploy, just run the following command on the same directory as files
```sh
docker-compose up -d
```
# Environnment variables
## TIMEZONE
If you need to set timezone for Apache and PHP
From commande line
```sh
docker run --name glpi --hostname glpi --link mysql:mysql --volumes-from glpi-data -p 80:80 --env "TIMEZONE=Europe/Brussels" -d diouxx/glpi
```
From docker-compose
Modify this settings
```yml
environment:
TIMEZONE=Europe/Brussels
```