diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c619071..a021634 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -17,6 +17,7 @@ RUN \ # && apk add autoconf automake make gcc g++ libtool pkgconfig shadow rsync redis nginx mariadb-client \ # APCu && pecl install apcu \ + && pecl install xhprof \ && docker-php-ext-enable apcu --ini-name 10-docker-php-ext-apcu.ini # Install xdebug diff --git a/.devcontainer/php/conf.d/dev-config.ini b/.devcontainer/php/conf.d/dev-config.ini index e330475..ee2b72e 100644 --- a/.devcontainer/php/conf.d/dev-config.ini +++ b/.devcontainer/php/conf.d/dev-config.ini @@ -4,3 +4,7 @@ display_errors = Off log_errors = On error_reporting = E_ALL error_log = /data/log/php/php_errors.log + +; profile +[xhprof] +extension=xhprof.so diff --git a/Dockerfile b/Dockerfile index a577090..b75707e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,9 @@ RUN \ libjpeg-turbo-dev \ patch \ supervisor \ + $PHPIZE_DEPS \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) gd gmp pdo_mysql exif \ + && docker-php-ext-install -j$(nproc) gd gmp pdo_mysql exif opcache \ # complier & shadow & rsync & redis & nginx && apk add autoconf automake make gcc g++ libtool pkgconfig shadow rsync redis nginx \ # APCu @@ -38,6 +39,7 @@ RUN \ freetype-dev \ libpng-dev \ libjpeg-turbo-dev \ + $PHPIZE_DEPS \ && rm /var/cache/apk/* \ # nginx log && mkdir -p /data/log/nginx \ @@ -45,6 +47,7 @@ RUN \ # php config ADD ./build/app/custom-php.ini "$PHP_INI_DIR/conf.d/" +ADD ./build/app/opcache.ini "$PHP_INI_DIR/conf.d/" # nginx ADD ./build/nginx/nginx.conf /etc/nginx/ diff --git a/build/app/opcache.ini b/build/app/opcache.ini new file mode 100644 index 0000000..559ed7c --- /dev/null +++ b/build/app/opcache.ini @@ -0,0 +1,9 @@ +[opcache] +opcache.enable=1 +opcache.revalidate_freq=0 +opcache.validate_timestamps=0 +opcache.max_accelerated_files=10000 +opcache.memory_consumption=192 +opcache.max_wasted_percentage=10 +opcache.interned_strings_buffer=16 +opcache.fast_shutdown=1