mirror of
https://github.com/ClusterCockpit/cc-docker.git
synced 2024-11-10 09:57:25 +01:00
add opcache, make xdebug install configurable
This commit is contained in:
parent
e44a6bae4d
commit
84669c28f2
1
.env
1
.env
@ -9,6 +9,7 @@ APP_ENVIRONMENT=prod
|
|||||||
########################################################################
|
########################################################################
|
||||||
# PHP
|
# PHP
|
||||||
########################################################################
|
########################################################################
|
||||||
|
PHP_XDEBUG_INIT=false
|
||||||
PHP_XDEBUG_MODE=debug,develop
|
PHP_XDEBUG_MODE=debug,develop
|
||||||
PHP_XDEBUG_CLIENT_PORT=9003
|
PHP_XDEBUG_CLIENT_PORT=9003
|
||||||
#> LINUX: 'docker0' interface IP of host
|
#> LINUX: 'docker0' interface IP of host
|
||||||
|
@ -27,6 +27,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./php-fpm
|
context: ./php-fpm
|
||||||
args:
|
args:
|
||||||
|
PHP_XDEBUG_INIT: ${PHP_XDEBUG_INIT}
|
||||||
PHP_XDEBUG_MODE: ${PHP_XDEBUG_MODE}
|
PHP_XDEBUG_MODE: ${PHP_XDEBUG_MODE}
|
||||||
PHP_XDEBUG_CLIENT_PORT: ${PHP_XDEBUG_CLIENT_PORT}
|
PHP_XDEBUG_CLIENT_PORT: ${PHP_XDEBUG_CLIENT_PORT}
|
||||||
PHP_XDEBUG_CLIENT_HOST: ${PHP_XDEBUG_CLIENT_HOST}
|
PHP_XDEBUG_CLIENT_HOST: ${PHP_XDEBUG_CLIENT_HOST}
|
||||||
|
@ -8,27 +8,29 @@ RUN apk add --no-cache $PHPIZE_DEPS \
|
|||||||
libldap \
|
libldap \
|
||||||
openldap-dev
|
openldap-dev
|
||||||
|
|
||||||
RUN pecl install xdebug-3.0.4 \
|
RUN docker-php-ext-install ldap \
|
||||||
&& docker-php-ext-enable xdebug
|
mysqli \
|
||||||
|
pdo_mysql \
|
||||||
|
opcache
|
||||||
|
|
||||||
RUN docker-php-ext-install ldap mysqli pdo_mysql
|
# Enable php8-xdebug if $PHP_XDEBUG_INIT is true
|
||||||
|
ARG PHP_XDEBUG_INIT=false
|
||||||
# Enable php8-xdebug if $PHP_XDEBUG_MODE is not empty
|
|
||||||
ARG PHP_XDEBUG_MODE=off
|
ARG PHP_XDEBUG_MODE=off
|
||||||
ARG PHP_XDEBUG_CLIENT_PORT=5902
|
ARG PHP_XDEBUG_CLIENT_PORT=5902
|
||||||
ARG PHP_XDEBUG_CLIENT_HOST=host.docker.internal
|
ARG PHP_XDEBUG_CLIENT_HOST=host.docker.internal
|
||||||
COPY xdebug.ini /etc/php8/conf.d/xdebug.ini.template
|
COPY xdebug.ini /etc/php8/conf.d/xdebug.ini.template
|
||||||
RUN if [[ "$PHP_XDEBUG_MODE" != "" ]]; then \
|
COPY error_reporting.ini /usr/local/etc/php/conf.d/error_reporting.ini
|
||||||
|
RUN if [[ "$PHP_XDEBUG_INIT" == "true" ]]; then \
|
||||||
|
pecl install xdebug-3.0.4; \
|
||||||
|
docker-php-ext-enable xdebug; \
|
||||||
export PHP_XDEBUG_MODE=$PHP_XDEBUG_MODE; \
|
export PHP_XDEBUG_MODE=$PHP_XDEBUG_MODE; \
|
||||||
export PHP_XDEBUG_CLIENT_PORT=$PHP_XDEBUG_CLIENT_PORT; \
|
export PHP_XDEBUG_CLIENT_PORT=$PHP_XDEBUG_CLIENT_PORT; \
|
||||||
export PHP_XDEBUG_CLIENT_HOST=$PHP_XDEBUG_CLIENT_HOST; \
|
export PHP_XDEBUG_CLIENT_HOST=$PHP_XDEBUG_CLIENT_HOST; \
|
||||||
envsubst < /etc/php8/conf.d/xdebug.ini.template > /etc/php8/conf.d/xdebug.ini; \
|
envsubst < /etc/php8/conf.d/xdebug.ini.template > /etc/php8/conf.d/xdebug.ini; \
|
||||||
|
cp /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini.back; \
|
||||||
|
cp /etc/php8/conf.d/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
|
||||||
|
rm -f /etc/php8/conf.d/xdebug.ini.template; \
|
||||||
fi
|
fi
|
||||||
RUN rm -f /etc/php8/conf.d/xdebug.ini.template
|
|
||||||
|
|
||||||
RUN cp /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini.back
|
|
||||||
RUN cp /etc/php8/conf.d/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
|
||||||
COPY error_reporting.ini /usr/local/etc/php/conf.d/error_reporting.ini
|
|
||||||
|
|
||||||
RUN curl -sS https://getcomposer.org/installer | tee composer-setup.php \
|
RUN curl -sS https://getcomposer.org/installer | tee composer-setup.php \
|
||||||
&& php composer-setup.php && rm composer-setup.php* \
|
&& php composer-setup.php && rm composer-setup.php* \
|
||||||
|
Loading…
Reference in New Issue
Block a user