Skip to content

feat: customizable PHP memory_limit via Helm and Docker env var#165

Closed
eduardofraga wants to merge 3 commits into
latestfrom
feat/php-memory
Closed

feat: customizable PHP memory_limit via Helm and Docker env var#165
eduardofraga wants to merge 3 commits into
latestfrom
feat/php-memory

Conversation

@eduardofraga

Copy link
Copy Markdown
Contributor

Summary

Adds the ability to customize PHP memory_limit across both deployment methods — Docker Compose and Helm/Kubernetes — without rebuilding images.

Changes

Docker

  • New docker/php/docker-entrypoint.sh — reads PHP_MEMORY_LIMIT env var (default 256M) and writes zz-custom.ini into PHP's ini scan directory at container start
  • Modified docker/php/Dockerfile.base — copies entrypoint script and sets ENTRYPOINT
  • Modified docker/.env.example — added PHP_MEMORY_LIMIT variable

Helm

  • Added glpi.phpfpm.phpConfig.memory_limit to values.yaml (default 256M)
  • Added glpi-php-config ConfigMap to glpi-configmap.yaml — renders zz-helm-custom.ini from values
  • Modified glpi-deployment.yaml — mounts the ConfigMap as a volume in the php-fpm container
  • Modified glpi-job.yaml — mounts in all 5 job types (verifyDir, dbInstall, dbUpgrade, dbConfigure, cacheConfigure)
  • Modified glpi-cronjob.yaml — mounts in the cronjob container

Design Notes

  • Files are prefixed zz- to ensure they load after the built-in 99-glpi.ini, allowing proper override
  • Docker uses an entrypoint script approach (chains to official docker-php-entrypoint)
  • Helm uses ConfigMap volume mounts (no image changes required)

Verification

Deployment Default Override
Docker 256M Set PHP_MEMORY_LIMIT=512M in .env
Helm 256M --set glpi.phpfpm.phpConfig.memory_limit=512M
  • hadolint — pass on both Dockerfiles
  • helm lint — pass (0 failures)
  • helm template — all resources rendered correctly
  • docker buildeftechcombr/glpi:base built and tested successfully
  • Runtime test: PHP_MEMORY_LIMIT=512M correctly overrides to 512M

…nv var

Add support for customizing PHP memory_limit across both deployment methods:

Docker:
- New docker-entrypoint.sh reads PHP_MEMORY_LIMIT env var (default: 256M)
  and writes zz-custom.ini at container start
- Updated Dockerfile.base to include entrypoint with execute permissions
- Added PHP_MEMORY_LIMIT to .env.example

Helm:
- New phpConfig.memory_limit value in values.yaml (default: 256M)
- New glpi-php-config ConfigMap rendering zz-helm-custom.ini
- Mounted as volume in php-fpm Deployment, all Jobs, and CronJob
- Uses zz- prefix to ensure load order after 99-glpi.ini
Add all PHP ini settings from docker/php/conf.d/99-glpi.ini as
configurable values: memory_limit, file_uploads, max_execution_time,
register_globals, magic_quotes_sybase, session.auto_start,
session.use_trans_sid, session.cookie_httponly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant