Début du projet

This commit is contained in:
root 2020-08-03 21:32:39 +02:00
commit e7ec47a6fa
10 changed files with 118 additions and 0 deletions

BIN
CAS-1.3.8.tgz Normal file

Binary file not shown.

48
Dockerfile Normal file
View File

@ -0,0 +1,48 @@
FROM php:7.4-apache-buster
MAINTAINER Benoit LORAND <benoit.lorand@blorand.org>
WORKDIR /root
RUN \
apt-get update && \
apt-get install --no-install-recommends -y \
supervisor \
cron \
libbz2-dev \
libzip-dev \
libxml2-dev \
libldap2-dev \
libicu-dev \
libpng-dev \
zlib1g-dev \
&& \
pecl install apcu && docker-php-ext-enable apcu && \
docker-php-ext-configure mysqli && docker-php-ext-install mysqli && \
docker-php-ext-configure gd && docker-php-ext-install gd && \
docker-php-ext-configure intl && docker-php-ext-install intl && \
docker-php-ext-configure ldap && docker-php-ext-install ldap && \
docker-php-ext-configure xmlrpc && docker-php-ext-install xmlrpc && \
docker-php-ext-configure exif && docker-php-ext-install exif && \
docker-php-ext-configure zip && docker-php-ext-install zip && \
docker-php-ext-configure bz2 && docker-php-ext-install bz2 && \
docker-php-ext-configure opcache && docker-php-ext-install opcache
ADD CAS-1.3.8.tgz /root
RUN pear install /root/CAS-1.3.8.tgz
ADD supervisor/supervisord.conf /etc/supervisor
ADD supervisor/conf.d/apache2.conf /etc/supervisor/conf.d
ADD supervisor/conf.d/cron.conf /etc/supervisor/conf.d
ADD supervisor/conf.d/glpi_init.conf /etc/supervisor/conf.d
ADD glpi_init.sh /root/glpi_init.sh
ADD glpi.cron /etc/cron.d/glpi
ADD https://github.com/glpi-project/glpi/releases/download/9.5.0/glpi-9.5.0.tgz /root/glpi-9.5.0.tgz
ADD https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/glpi9.5.0%2B1.0/fusioninventory-9.5.0+1.0.tar.bz2 /root/fusioninventory-9.5.0+1.0.tar.bz2
RUN \
chmod a+x /root/glpi_init.sh && \
rm -f /var/www/html/* /root/CAS-1.3.8.tgz && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENTRYPOINT ["supervisord", "--nodaemon", "--configuration", "/etc/supervisor/supervisord.conf"]

0
README.md Normal file
View File

25
docker-compose.yml Normal file
View File

@ -0,0 +1,25 @@
version: '3.5'
services:
web:
container_name: glpi-web
build: .
restart: always
ports:
- 8089:80
volumes:
- ./www:/var/www/html
depends_on:
- db
db:
image: mysql:5.7
container_name: glpi-db
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
MYSQL_DATABASE: mysql_db_name
MYSQL_USER: mysql_db_user
MYSQL_PASSWORD: mysql_db_password
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- ./db:/var/lib/mysql

1
glpi.cron Normal file
View File

@ -0,0 +1 @@
* * * * * root /usr/local/bin/php /var/www/html/front/cron.php &>/dev/null

16
glpi_init.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/sh
GLPI_TARBALL="/root/glpi-9.5.0.tgz"
FUSION_TARBALL="/root/fusioninventory-9.5.0+1.0.tar.bz2"
if [ -z $(ls -A /var/www/html) ] ; then
echo "Initilazing ${GLPI_TARBALL}"
cd /root
tar xf ${GLPI_TARBALL}
cp -r /root/glpi/. /var/www/html/.
cd /var/www/html/plugins
tar xf ${FUSION_TARBALL}
chown -R www-data:www-data /var/www/html
rm -r /root/glpi
else
echo "GLPI is already initialized"
fi

View File

@ -0,0 +1,4 @@
[program:apache2]
command=apache2-foreground
autostart=true
autorestart=true

View File

@ -0,0 +1,4 @@
[program:cron]
command=cron -f -L 15
autostart=true
autorestart=true

View File

@ -0,0 +1,5 @@
[program:glpi_init]
command=/root/glpi_init.sh
startsecs = 0
autorestart = false
startretries = 1

View File

@ -0,0 +1,15 @@
; supervisor config file
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf