From 5fce7388783b9a4f84d7cab1d31e84c14d7d7495 Mon Sep 17 00:00:00 2001 From: Chingis Sandanov Date: Fri, 19 Jan 2024 19:22:54 +0300 Subject: [PATCH] Add PHP_GRPC_ env vars for configuring grpc extension --- 8/docker-entrypoint.sh | 1 + 8/templates/docker-php-ext-grpc.ini.tmpl | 9 ++ README.md | 193 ++++++++++++----------- 3 files changed, 114 insertions(+), 89 deletions(-) create mode 100644 8/templates/docker-php-ext-grpc.ini.tmpl diff --git a/8/docker-entrypoint.sh b/8/docker-entrypoint.sh index 1810b0c..561a78d 100755 --- a/8/docker-entrypoint.sh +++ b/8/docker-entrypoint.sh @@ -66,6 +66,7 @@ process_templates() { _gotpl "docker-php-${php_ver_minor}.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php.ini" _gotpl "docker-php-ext-apcu.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini" _gotpl "docker-php-ext-brotli.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-brotli.ini" + _gotpl "docker-php-ext-grpc.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-grpc.ini" _gotpl "docker-php-ext-igbinary.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini" _gotpl "docker-php-ext-xhprof.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-xhprof.ini" _gotpl "docker-php-ext-xdebug.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini" diff --git a/8/templates/docker-php-ext-grpc.ini.tmpl b/8/templates/docker-php-ext-grpc.ini.tmpl new file mode 100644 index 0000000..a64e789 --- /dev/null +++ b/8/templates/docker-php-ext-grpc.ini.tmpl @@ -0,0 +1,9 @@ +[grpc] +extension=grpc.so +grpc.enable_fork_support = {{ getenv "PHP_GRPC_ENABLE_FORK_SUPPORT" "1" }} +grpc.poll_strategy = {{ getenv "PHP_GRPC_POLL_STRATEGY" "epoll1" }} +grpc.grpc_verbosity = {{ getenv "PHP_GRPC_VERBOSITY" "error" }} +grpc.log_filename = {{ getenv "PHP_GRPC_LOG_FILENAME" "/proc/self/fd/2" }} +{{- if getenv "PHP_GRPC_TRACE" }} +grpc.grpc_trace = {{ getenv "PHP_GRPC_TRACE" }} +{{- end }} diff --git a/README.md b/README.md index c4f52b3..f8a588a 100644 --- a/README.md +++ b/README.md @@ -73,95 +73,100 @@ All images built for `linux/amd64` and `linux/arm64` The default configuration not recommended for use for production environment: -| Variable | 8.3 | 8.2 | 8.1 | -|-----------------------------------------|----------------|----------------|----------------| -| [`PHP_ALLOW_URL_FOPEN`] | `On` | `On` | `On` | -| [`PHP_APCU_ENABLE_CLI`] | `0` | `0` | `0` | -| [`PHP_APCU_ENABLED`] | `1` | `1` | `1` | -| [`PHP_APCU_ENTRIES_HINT`] | `4096` | `4096` | `4096` | -| [`PHP_APCU_COREDUMP_UNMAP`] | `0` | `0` | `0` | -| [`PHP_APCU_GC_TTL`] | `3600` | `3600` | `3600` | -| [`PHP_APCU_PRELOAD_PATH`] | `NULL` | `NULL` | `NULL` | -| [`PHP_APCU_SERIALIZER`] | | | | -| [`PHP_APCU_SHM_SEGMENTS`] | `1` | `1` | `1` | -| [`PHP_APCU_SHM_SIZE`] | `32M` | `32M` | `32M` | -| [`PHP_APCU_SLAM_DEFENSE`] | `1` | `1` | `1` | -| [`PHP_APCU_TTL`] | `0` | `0` | `0` | -| [`PHP_APCU_USE_REQUEST_TIME`] | `1` | `1` | `1` | -| [`PHP_ASSERT_ACTIVE`] | `On` | `On` | `On` | -| [`PHP_AUTO_PREPEND_FILE`] | | | | -| [`PHP_AUTO_APPEND_FILE`] | | | | -| `PHP_BROTLI_OUTPUT_COMPRESSION` | `0` | `0` | `0` | -| `PHP_BROTLI_OUTPUT_COMPRESSION_LEVEL` | `-1` | `-1` | `-1` | -| `PHP_CLI_MEMORY_LIMIT` | `-1` | `-1` | `-1` | -| [`PHP_DATE_TIMEZONE`] | `UTC` | `UTC` | `UTC` | -| [`PHP_DEFAULT_SOCKET_TIMEOUT`] | `60` | `60` | `60` | -| [`PHP_DISPLAY_ERRORS`] | `On` | `On` | `On` | -| [`PHP_DISPLAY_STARTUP_ERRORS`] | `On` | `On` | `On` | -| [`PHP_ERROR_REPORTING`] | `E_ALL` | `E_ALL` | `E_ALL` | -| [`PHP_EXPOSE`] | `Off` | `Off` | `Off` | -| `PHP_EXTENSIONS_DISABLE` | | | | -| [`PHP_FPM_CLEAR_ENV`] | `yes` | `yes` | `yes` | -| `PHP_FPM_ENV_VARS` | | | | -| [`PHP_FPM_LOG_LEVEL`] | `notice` | `notice` | `notice` | -| [`PHP_FPM_PM`] | `dynamic` | `dynamic` | `dynamic` | -| [`PHP_FPM_PM_MAX_CHILDREN`] | `8` | `8` | `8` | -| [`PHP_FPM_PM_MAX_REQUESTS`] | `500` | `500` | `500` | -| [`PHP_FPM_PM_MAX_SPARE_SERVERS`] | `3` | `3` | `3` | -| [`PHP_FPM_PM_MIN_SPARE_SERVERS`] | `1` | `1` | `1` | -| [`PHP_FPM_PM_STATUS_PATH`] | | | | -| [`PHP_FPM_REQUEST_SLOWLOG_TIMEOUT`] | | | | -| [`PHP_FPM_PM_START_SERVERS`] | `2` | `2` | `2` | -| [`PHP_FPM_USER`] | `www-data` | `www-data` | `www-data` | -| [`PHP_FPM_GROUP`] | `www-data` | `www-data` | `www-data` | -| `PHP_IGBINARY_COMPACT_STRINGS` | `On` | `On` | `On` | -| [`PHP_LOG_ERRORS`] | `On` | `On` | `On` | -| [`PHP_LOG_ERRORS_MAX_LEN`] | `0` | `0` | `0` | -| [`PHP_MAX_EXECUTION_TIME`] | `120` | `120` | `120` | -| [`PHP_MAX_FILE_UPLOADS`] | `20` | `20` | `20` | -| [`PHP_MAX_INPUT_TIME`] | `60` | `60` | `60` | -| [`PHP_MAX_INPUT_VARS`] | `2000` | `2000` | `2000` | -| [`PHP_MEMORY_LIMIT`] | `512M` | `512M` | `512M` | -| [`PHP_MYSQLI_CACHE_SIZE`] | `2000` | `2000` | `2000` | -| [`PHP_NEWRELIC_ENABLED`] | `false` | `false` | `false` | -| [`PHP_NEWRELIC_LICENSE`] | | | | -| _see all newrelic ext options_ | [8.x newrelic] | [8.x newrelic] | [8.x newrelic] | -| [`PHP_OPCACHE_ENABLE`] | `1` | `1` | `1` | -| [`PHP_OPCACHE_ENABLE_CLI`] | `0` | `0` | `0` | -| [`PHP_OPCACHE_VALIDATE_TIMESTAMPS`] | `1` | `1` | `1` | -| [`PHP_OPCACHE_REVALIDATE_FREQ`] | `2` | `2` | `2` | -| [`PHP_OPCACHE_MAX_ACCELERATED_FILES`] | `4000` | `4000` | `4000` | -| [`PHP_OPCACHE_MEMORY_CONSUMPTION`] | `128` | `128` | `128` | -| [`PHP_OPCACHE_INTERNED_STRINGS_BUFFER`] | `8` | `8` | `8` | -| [`PHP_OPCACHE_FAST_SHUTDOWN`] | - | - | - | -| [`PHP_OPCACHE_HUGE_CODE_PAGES`] | `0` | `0` | `0` | -| [`PHP_OPCACHE_PRELOAD`] | - | - | - | -| [`PHP_OPCACHE_PRELOAD_USER`] | `www-data` | `www-data` | `www-data` | -| [`PHP_OPCACHE_JIT`] | `tracing` | `tracing` | `tracing` | -| [`PHP_OPCACHE_JIT_BUFFER_SIZE`] | `0` | `0` | `0` | -| [`PHP_OUTPUT_BUFFERING`] | `4096` | `4096` | `4096` | -| [`PHP_PCOV_ENABLED`] | `0` | `0` | `0` | -| _see all pcov ext options_ | [8.x pcov] | [8.x pcov] | [8.x pcov] | -| [`PHP_PDO_MYSQL_CACHE_SIZE`] | - | - | - | -| [`PHP_PHAR_READONLY`] | `1` | `1` | `1` | -| [`PHP_PHAR_REQUIRE_HASH`] | `1` | `1` | `1` | -| [`PHP_PHAR_CACHE_LIST`] | | | | -| [`PHP_POST_MAX_SIZE`] | `32M` | `32M` | `32M` | -| [`PHP_REALPATH_CACHE_SIZE`] | `4096k` | `4096k` | `4096k` | -| [`PHP_REALPATH_CACHE_TTL`] | `120` | `120` | `120` | -| [`PHP_SENDMAIL_PATH`] | `/bin/true` | `/bin/true` | `/bin/true` | -| `PHP_MAIL_MIXED_LF_AND_CRLF` | `Off` | `Off` | - | -| [`PHP_SESSION_SAVE_HANDLER`] | `files` | `files` | `files` | -| [`PHP_SHORT_OPEN_TAG`] | `1` | `1` | `1` | -| _see all sqlsrv ext options_ | - | - | - | -| _see all session options_ | [8.3 session] | [8.2 session] | [8.1 session] | -| `PHP_XHPROF` | | | | -| _see all xhprof options_ | [8.x xhprof] | [8.x xhprof] | [8.x xhprof] | -| [`PHP_UPLOAD_MAX_FILESIZE`] | `32M` | `32M` | `32M` | -| [`PHP_XDEBUG`] | | | | -| [`PHP_XDEBUG_MODE`] | `off` | `off` | `off` | -| _see all xdebug ext options_ | [8.x xdebug] | [8.x xdebug] | [8.x xdebug] | -| [`PHP_ZEND_ASSERTIONS`] | `1` | `1` | `1` | +| Variable | 8.3 | 8.2 | 8.1 | +|-----------------------------------------|-------------------|-------------------|-------------------| +| [`PHP_ALLOW_URL_FOPEN`] | `On` | `On` | `On` | +| [`PHP_APCU_ENABLE_CLI`] | `0` | `0` | `0` | +| [`PHP_APCU_ENABLED`] | `1` | `1` | `1` | +| [`PHP_APCU_ENTRIES_HINT`] | `4096` | `4096` | `4096` | +| [`PHP_APCU_COREDUMP_UNMAP`] | `0` | `0` | `0` | +| [`PHP_APCU_GC_TTL`] | `3600` | `3600` | `3600` | +| [`PHP_APCU_PRELOAD_PATH`] | `NULL` | `NULL` | `NULL` | +| [`PHP_APCU_SERIALIZER`] | | | | +| [`PHP_APCU_SHM_SEGMENTS`] | `1` | `1` | `1` | +| [`PHP_APCU_SHM_SIZE`] | `32M` | `32M` | `32M` | +| [`PHP_APCU_SLAM_DEFENSE`] | `1` | `1` | `1` | +| [`PHP_APCU_TTL`] | `0` | `0` | `0` | +| [`PHP_APCU_USE_REQUEST_TIME`] | `1` | `1` | `1` | +| [`PHP_ASSERT_ACTIVE`] | `On` | `On` | `On` | +| [`PHP_AUTO_PREPEND_FILE`] | | | | +| [`PHP_AUTO_APPEND_FILE`] | | | | +| `PHP_BROTLI_OUTPUT_COMPRESSION` | `0` | `0` | `0` | +| `PHP_BROTLI_OUTPUT_COMPRESSION_LEVEL` | `-1` | `-1` | `-1` | +| `PHP_CLI_MEMORY_LIMIT` | `-1` | `-1` | `-1` | +| [`PHP_DATE_TIMEZONE`] | `UTC` | `UTC` | `UTC` | +| [`PHP_DEFAULT_SOCKET_TIMEOUT`] | `60` | `60` | `60` | +| [`PHP_DISPLAY_ERRORS`] | `On` | `On` | `On` | +| [`PHP_DISPLAY_STARTUP_ERRORS`] | `On` | `On` | `On` | +| [`PHP_ERROR_REPORTING`] | `E_ALL` | `E_ALL` | `E_ALL` | +| [`PHP_EXPOSE`] | `Off` | `Off` | `Off` | +| `PHP_EXTENSIONS_DISABLE` | | | | +| [`PHP_FPM_CLEAR_ENV`] | `yes` | `yes` | `yes` | +| `PHP_FPM_ENV_VARS` | | | | +| [`PHP_FPM_LOG_LEVEL`] | `notice` | `notice` | `notice` | +| [`PHP_FPM_PM`] | `dynamic` | `dynamic` | `dynamic` | +| [`PHP_FPM_PM_MAX_CHILDREN`] | `8` | `8` | `8` | +| [`PHP_FPM_PM_MAX_REQUESTS`] | `500` | `500` | `500` | +| [`PHP_FPM_PM_MAX_SPARE_SERVERS`] | `3` | `3` | `3` | +| [`PHP_FPM_PM_MIN_SPARE_SERVERS`] | `1` | `1` | `1` | +| [`PHP_FPM_PM_STATUS_PATH`] | | | | +| [`PHP_FPM_REQUEST_SLOWLOG_TIMEOUT`] | | | | +| [`PHP_FPM_PM_START_SERVERS`] | `2` | `2` | `2` | +| [`PHP_FPM_USER`] | `www-data` | `www-data` | `www-data` | +| [`PHP_FPM_GROUP`] | `www-data` | `www-data` | `www-data` | +| [`PHP_GRPC_ENABLE_FORK_SUPPORT`] | `1` | `1` | `1` | +| [`PHP_GRPC_LOG_FILENAME`] | `/proc/self/fd/2` | `/proc/self/fd/2` | `/proc/self/fd/2` | +| [`PHP_GRPC_POLL_STRATEGY`] | `epoll1` | `epoll1` | `epoll1` | +| [`PHP_GRPC_TRACE`] | | | | +| [`PHP_GRPC_VERBOSITY`] | `error` | `error` | `error` | +| `PHP_IGBINARY_COMPACT_STRINGS` | `On` | `On` | `On` | +| [`PHP_LOG_ERRORS`] | `On` | `On` | `On` | +| [`PHP_LOG_ERRORS_MAX_LEN`] | `0` | `0` | `0` | +| [`PHP_MAX_EXECUTION_TIME`] | `120` | `120` | `120` | +| [`PHP_MAX_FILE_UPLOADS`] | `20` | `20` | `20` | +| [`PHP_MAX_INPUT_TIME`] | `60` | `60` | `60` | +| [`PHP_MAX_INPUT_VARS`] | `2000` | `2000` | `2000` | +| [`PHP_MEMORY_LIMIT`] | `512M` | `512M` | `512M` | +| [`PHP_MYSQLI_CACHE_SIZE`] | `2000` | `2000` | `2000` | +| [`PHP_NEWRELIC_ENABLED`] | `false` | `false` | `false` | +| [`PHP_NEWRELIC_LICENSE`] | | | | +| _see all newrelic ext options_ | [8.x newrelic] | [8.x newrelic] | [8.x newrelic] | +| [`PHP_OPCACHE_ENABLE`] | `1` | `1` | `1` | +| [`PHP_OPCACHE_ENABLE_CLI`] | `0` | `0` | `0` | +| [`PHP_OPCACHE_VALIDATE_TIMESTAMPS`] | `1` | `1` | `1` | +| [`PHP_OPCACHE_REVALIDATE_FREQ`] | `2` | `2` | `2` | +| [`PHP_OPCACHE_MAX_ACCELERATED_FILES`] | `4000` | `4000` | `4000` | +| [`PHP_OPCACHE_MEMORY_CONSUMPTION`] | `128` | `128` | `128` | +| [`PHP_OPCACHE_INTERNED_STRINGS_BUFFER`] | `8` | `8` | `8` | +| [`PHP_OPCACHE_FAST_SHUTDOWN`] | - | - | - | +| [`PHP_OPCACHE_HUGE_CODE_PAGES`] | `0` | `0` | `0` | +| [`PHP_OPCACHE_PRELOAD`] | - | - | - | +| [`PHP_OPCACHE_PRELOAD_USER`] | `www-data` | `www-data` | `www-data` | +| [`PHP_OPCACHE_JIT`] | `tracing` | `tracing` | `tracing` | +| [`PHP_OPCACHE_JIT_BUFFER_SIZE`] | `0` | `0` | `0` | +| [`PHP_OUTPUT_BUFFERING`] | `4096` | `4096` | `4096` | +| [`PHP_PCOV_ENABLED`] | `0` | `0` | `0` | +| _see all pcov ext options_ | [8.x pcov] | [8.x pcov] | [8.x pcov] | +| [`PHP_PDO_MYSQL_CACHE_SIZE`] | - | - | - | +| [`PHP_PHAR_READONLY`] | `1` | `1` | `1` | +| [`PHP_PHAR_REQUIRE_HASH`] | `1` | `1` | `1` | +| [`PHP_PHAR_CACHE_LIST`] | | | | +| [`PHP_POST_MAX_SIZE`] | `32M` | `32M` | `32M` | +| [`PHP_REALPATH_CACHE_SIZE`] | `4096k` | `4096k` | `4096k` | +| [`PHP_REALPATH_CACHE_TTL`] | `120` | `120` | `120` | +| [`PHP_SENDMAIL_PATH`] | `/bin/true` | `/bin/true` | `/bin/true` | +| `PHP_MAIL_MIXED_LF_AND_CRLF` | `Off` | `Off` | - | +| [`PHP_SESSION_SAVE_HANDLER`] | `files` | `files` | `files` | +| [`PHP_SHORT_OPEN_TAG`] | `1` | `1` | `1` | +| _see all sqlsrv ext options_ | - | - | - | +| _see all session options_ | [8.3 session] | [8.2 session] | [8.1 session] | +| `PHP_XHPROF` | | | | +| _see all xhprof options_ | [8.x xhprof] | [8.x xhprof] | [8.x xhprof] | +| [`PHP_UPLOAD_MAX_FILESIZE`] | `32M` | `32M` | `32M` | +| [`PHP_XDEBUG`] | | | | +| [`PHP_XDEBUG_MODE`] | `off` | `off` | `off` | +| _see all xdebug ext options_ | [8.x xdebug] | [8.x xdebug] | [8.x xdebug] | +| [`PHP_ZEND_ASSERTIONS`] | `1` | `1` | `1` | > "-" - Not available for this version @@ -466,6 +471,16 @@ default params values: [`PHP_FPM_REQUEST_SLOWLOG_TIMEOUT`]: http://php.net/manual/en/install.fpm.configuration.php#request-slowlog-timeout +[`PHP_GRPC_ENABLE_FORK_SUPPORT`]: https://github.com/grpc/grpc/blob/master/doc/environment_variables.md + +[`PHP_GRPC_POLL_STRATEGY`]: https://github.com/grpc/grpc/blob/master/doc/environment_variables.md + +[`PHP_GRPC_LOG_FILENAME`]: https://github.com/grpc/grpc/blob/master/doc/environment_variables.md + +[`PHP_GRPC_TRACE`]: https://github.com/grpc/grpc/blob/master/doc/environment_variables.md + +[`PHP_GRPC_VERBOSITY`]: https://github.com/grpc/grpc/blob/master/doc/environment_variables.md + [`PHP_FPM_USER`]: http://php.net/manual/en/install.fpm.configuration.php#user [`PHP_LOG_ERRORS_MAX_LEN`]: http://php.net/log-errors-max-len