diff --git a/docker-compose.yml b/docker-compose.yml index 6c6b405..399d192 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,14 +6,14 @@ version: "3.3" # ----------------------------------------------------------------------------- services: - glpidb: + db: image: mysql:8.0.26 restart: always networks: - web-db - admin-db volumes: - - glpi_database:/var/lib/mysql # CHANGE + - database:/var/lib/mysql # CHANGE - ./glpidb/scripts:/scripts command: mysqld --default-authentication-plugin=mysql_native_password secrets: @@ -34,8 +34,8 @@ services: timeout: 10s retries: 10 - glpi: - image: my_glpi # CHANGE + web: + image: glpi # CHANGE build: context: ./glpi dockerfile: dockerfile @@ -44,7 +44,7 @@ services: networks: - web-db depends_on: - - glpidb + - db ports: - 50080:80 # CHANGE volumes: @@ -66,7 +66,7 @@ services: phpmyadmin: image: phpmyadmin:5.0-apache depends_on: - - glpidb + - db ports: - 50180:80 # CHANGE networks: @@ -76,14 +76,14 @@ services: environment: - TZ=Africa/Algiers # CHANGE - PMA_HOST_FILE=/run/secrets/DB_SERVER - - UPLOAD_LIMIT=300M + - UPLOAD_LIMIT=300M # CHANGE networks: web-db: admin-db: volumes: - glpi_database: # CHANGE + database: # CHANGE secrets: DB_SERVER: diff --git a/glpi/dockerfile b/glpi/dockerfile index b0a4fe8..aa417cf 100644 --- a/glpi/dockerfile +++ b/glpi/dockerfile @@ -24,7 +24,8 @@ RUN \ && \ docker-php-ext-install exif \ && \ - apt-get install -y libpng-dev libjpeg-dev && \ + apt-get install -y libpng-dev libjpeg-dev libwebp-dev && \ + docker-php-ext-configure gd --with-jpeg --with-webp &&\ docker-php-ext-install gd \ && \ apt-get install -y libc-client-dev libkrb5-dev && \ diff --git a/glpi/scripts/files_backer.sh b/glpi/scripts/files_backer.sh index fee8b08..3c6c679 100644 --- a/glpi/scripts/files_backer.sh +++ b/glpi/scripts/files_backer.sh @@ -16,7 +16,8 @@ # Script to create a web directory backup -TIMESTAMP=$(date +"%FT%H-%M-%S") +TIMESTAMP=$(date -u +"%FT%H-%M-%S") +TIMESTAMP=$(date +"%FT%H-%M-%S%z") BACKUP_FILE_NAME=glpi_web_backup_"$TIMESTAMP" tar ckzf /backups/"$BACKUP_FILE_NAME".tar.gz /var/www/html diff --git a/glpi/scripts/files_backer_cron.sh b/glpi/scripts/files_backer_cron.sh index 1153340..1f8b1b5 100644 --- a/glpi/scripts/files_backer_cron.sh +++ b/glpi/scripts/files_backer_cron.sh @@ -6,7 +6,7 @@ # ----------------------------------------------------------------------------- # Script to create a cronjob for web directory backup -echo "*/1 * * * * root /scripts/files_backer.sh" >/etc/cron.d/files_backer && +echo "0 */4 * * * root /scripts/files_backer.sh" >/etc/cron.d/files_backer && chown root /etc/cron.d/files_backer && chgrp root /etc/cron.d/files_backer && chmod 0700 /etc/cron.d/files_backer && diff --git a/glpi/scripts/install.sh b/glpi/scripts/install.sh index 9017d27..58c22a6 100644 --- a/glpi/scripts/install.sh +++ b/glpi/scripts/install.sh @@ -6,6 +6,7 @@ # ----------------------------------------------------------------------------- /scripts/install_glpi.sh +/scripts/files_backer_cron.sh /scripts/install_fusioninventory.sh /scripts/_install_datainjection.sh /scripts/_install_mreporting.sh diff --git a/glpi/scripts/install_fusioninventory.sh b/glpi/scripts/install_fusioninventory.sh index c337c93..ab42093 100644 --- a/glpi/scripts/install_fusioninventory.sh +++ b/glpi/scripts/install_fusioninventory.sh @@ -22,7 +22,7 @@ curl -L https://github.com/fusioninventory/fusioninventory-for-glpi/releases/dow glpicli plugin:install fusioninventory -u glpi && glpicli plugin:activate fusioninventory && chown -R www-data /var/www/html && - echo "* */6 * * * root php /var/www/html/front/cron.php &>/dev/null" >/etc/cron.d/fusioninventory_taskschedular && + echo "* * * * * root php /var/www/html/front/cron.php &>/dev/null" >/etc/cron.d/fusioninventory_taskschedular && chown root /etc/cron.d/fusioninventory_taskschedular && chgrp root /etc/cron.d/fusioninventory_taskschedular && chmod 0700 /etc/cron.d/fusioninventory_taskschedular && diff --git a/secrets/DB_SERVER b/secrets/DB_SERVER index 0c876ac..5baa59d 100644 --- a/secrets/DB_SERVER +++ b/secrets/DB_SERVER @@ -1 +1 @@ -glpidb \ No newline at end of file +db \ No newline at end of file