Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/php g rpc #3395

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Expand Up @@ -213,6 +213,7 @@ WORKSPACE_PROTOC_VERSION=latest
WORKSPACE_INSTALL_MEMCACHED=true
WORKSPACE_INSTALL_EVENT=false
WORKSPACE_INSTALL_DNSUTILS=true
WORKSPACE_INSTALL_GRPC=false
WORKSPACE_XDEBUG_PORT=9000
WORKSPACE_VITE_PORT=5173

Expand Down Expand Up @@ -289,6 +290,7 @@ PHP_FPM_DEFAULT_LOCALE=POSIX
PHP_FPM_XDEBUG_PORT=9000
PHP_FPM_INSTALL_EVENT=false
PHP_FPM_INSTALL_DNSUTILS=true
PHP_FPM_INSTALL_GRPC=false

PHP_FPM_PUID=1000
PHP_FPM_PGID=1000
Expand Down Expand Up @@ -335,6 +337,7 @@ PHP_WORKER_INSTALL_XMLRPC=false
PHP_WORKER_INSTALL_SSDB=false
PHP_WORKER_INSTALL_EVENT=false
PHP_WORKER_INSTALL_INTL=true
PHP_WORKER_INSTALL_GRPC=false

PHP_WORKER_PUID=1000
PHP_WORKER_PGID=1000
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Expand Up @@ -176,6 +176,7 @@ services:
- INSTALL_MEMCACHED=${WORKSPACE_INSTALL_MEMCACHED}
- INSTALL_EVENT=${WORKSPACE_INSTALL_EVENT}
- INSTALL_DNSUTILS=${WORKSPACE_INSTALL_DNSUTILS}
- INSTALL_GRPC=${WORKSPACE_INSTALL_GRPC}
- http_proxy
- https_proxy
- no_proxy
Expand Down Expand Up @@ -294,6 +295,7 @@ services:
- PHP_FPM_NEW_RELIC_APP_NAME=${PHP_FPM_NEW_RELIC_APP_NAME}
- INSTALL_DOCKER_CLIENT=${PHP_FPM_INSTALL_DOCKER_CLIENT}
- INSTALL_DNSUTILS=${PHP_FPM_INSTALL_DNSUTILS}
- INSTALL_GRPC=${PHP_FPM_INSTALL_GRPC}
- http_proxy
- https_proxy
- no_proxy
Expand Down Expand Up @@ -359,6 +361,7 @@ services:
- INSTALL_SSDB=${PHP_WORKER_INSTALL_SSDB}
- INSTALL_EVENT=${PHP_WORKER_INSTALL_EVENT}
- INSTALL_INTL=${PHP_WORKER_INSTALL_INTL}
- INSTALL_GRPC=${PHP_WORKER_INSTALL_GRPC}
- PUID=${PHP_WORKER_PUID}
- PGID=${PHP_WORKER_PGID}
- IMAGEMAGICK_VERSION=${PHP_WORKER_IMAGEMAGICK_VERSION}
Expand Down
20 changes: 20 additions & 0 deletions php-fpm/Dockerfile
Expand Up @@ -1289,6 +1289,26 @@ RUN if [ ${INSTALL_DNSUTILS} = true ]; then \
apt-get update && apt-get install -y dnsutils \
;fi

###########################################################################
# INSTALL PHP GRPC:
###########################################################################

USER root

ARG INSTALL_GRPC=false

RUN if [ ${INSTALL_GRPC} = true ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") < "7" ]; then \
echo "PHP Driver for gRPC is not supported for PHP < 7"; \
fi &&\
pecl install grpc &&\
docker-php-ext-enable grpc &&\
php -m | grep -q 'grpc' &&\
pecl install protobuf &&\
docker-php-ext-enable protobuf &&\
php -m | grep -q 'protobuf' \
;fi

###########################################################################
# Check PHP version:
###########################################################################
Expand Down
20 changes: 20 additions & 0 deletions php-worker/Dockerfile
Expand Up @@ -564,6 +564,26 @@ RUN set -eux; \
php -m | grep -q 'event' \
;fi

###########################################################################
# INSTALL PHP GRPC:
###########################################################################

USER root

ARG INSTALL_GRPC=false

RUN if [ ${INSTALL_GRPC} = true ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") < "7" ]; then \
echo "PHP Driver for gRPC is not supported for PHP < 7"; \
fi &&\
pecl install grpc &&\
docker-php-ext-enable grpc &&\
php -m | grep -q 'grpc' &&\
pecl install protobuf &&\
docker-php-ext-enable protobuf &&\
php -m | grep -q 'protobuf' \
;fi

#
#--------------------------------------------------------------------------
# Optional Supervisord Configuration
Expand Down
20 changes: 20 additions & 0 deletions workspace/Dockerfile
Expand Up @@ -1825,6 +1825,26 @@ RUN if [ ${INSTALL_DNSUTILS} = true ]; then \
apt-get update && apt-get install -y dnsutils \
;fi

###########################################################################
# INSTALL PHP GRPC:
###########################################################################

USER root

ARG INSTALL_GRPC=false

RUN if [ ${INSTALL_GRPC} = true ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") < "7" ]; then \
echo "PHP Driver for gRPC is not supported for PHP < 7"; \
fi &&\
pecl install grpc &&\
echo "extension=grpc.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/grpc.ini &&\
echo "extension=grpc.so" >> /etc/php/${LARADOCK_PHP_VERSION}/cli/php.ini &&\
pecl install protobuf &&\
echo "extension=protobuf.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/protobuf.ini &&\
echo "extension=protobuf.so" >> /etc/php/${LARADOCK_PHP_VERSION}/cli/php.ini \
;fi

#
#--------------------------------------------------------------------------
# Final Touch
Expand Down