Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ MARIADB_DATABASE="glpi"
MARIADB_USER="glpi"
MARIADB_PASSWORD="glpi"
MARIADB_ROOT_PASSWORD="my-secret-pw"
CACHE_DSN="redis://redis:6379"
# MARIADB_RANDOM_ROOT_PASSWORD="1"
19 changes: 19 additions & 0 deletions docker/docker-compose-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
services:
redis:
image: redis:7.0-alpine
restart: unless-stopped
ports:
- 6379:6379
mariadb:
image: mariadb:11.4
restart: unless-stopped
Expand Down Expand Up @@ -55,6 +60,20 @@ services:
command:
- /usr/local/bin/glpi-db-configure.sh

glpi-cache-configure:
image: eftechcombr/glpi:php-fpm-10.0.18
restart: on-failure
volumes:
- glpi-marketplace:/var/www/html/marketplace:rw
- glpi-files:/var/lib/glpi:rw
- glpi-etc:/etc/glpi:rw
env_file: ./.env
depends_on:
- glpi-verify-dir
command:
- /usr/local/bin/glpi-cache-configure.sh


php:
build: php/
image: eftechcombr/glpi:php-fpm-10.0.18
Expand Down
6 changes: 6 additions & 0 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM php:8.3.12-fpm-alpine3.20

ENV VERSION=10.0.18
ENV GLPI_LANG=en_US
ENV CACHE_DSN=redis://redis:6379/
ENV MARIADB_HOST=mariadb-glpi
ENV MARIADB_PORT=3306
ENV MARIADB_DATABASE=glpi
Expand Down Expand Up @@ -49,6 +50,11 @@ RUN apk add libzip-dev \
RUN apk add openldap-dev \
&& docker-php-ext-install ldap

RUN apk add --no-cache pcre-dev ${PHPIZE_DEPS} \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& apk del pcre-dev ${PHPIZE_DEPS}

RUN docker-php-ext-install opcache

RUN docker-php-source delete
Expand Down
11 changes: 11 additions & 0 deletions docker/php/scripts/glpi-cache-configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

cacheConfigure () {
if [ -z "$CACHE_DSN" ]; then
echo "CACHE_DSN is not set. Skipping cache configuration."
return
fi
php bin/console cache:configure --dsn="$CACHE_DSN" --no-interaction
}

cacheConfigure