Skip to content

Commit

Permalink
Merge pull request #1114 from brefphp/php81-xdebug
Browse files Browse the repository at this point in the history
Re-enable xdebug in the PHP 8.1 dev container following #980 and #1007
  • Loading branch information
mnapoli authored Dec 7, 2021
2 parents cba16ff + 552dc6d commit c75867b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ docker-images:
cd layers/fpm-dev ; docker build -t bref/php-73-fpm-dev --build-arg PHP_VERSION=73 .
cd layers/fpm-dev ; docker build -t bref/php-74-fpm-dev --build-arg PHP_VERSION=74 .
cd layers/fpm-dev ; docker build -t bref/php-80-fpm-dev --build-arg PHP_VERSION=80 .
cd layers/fpm-dev ; docker build -t bref/php-81-fpm-dev --build-arg PHP_VERSION=81 --target=without_extensions .
cd layers/fpm-dev ; docker build -t bref/php-81-fpm-dev --build-arg PHP_VERSION=81 .
cd layers/web; docker build -t bref/fpm-dev-gateway .
# Run tests
php layers/tests.php
30 changes: 12 additions & 18 deletions runtime/layers/fpm-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
ARG PHP_VERSION
FROM bref/php-${PHP_VERSION}-fpm as without_extensions

# Override the config so that PHP-FPM listens on port 9000
COPY php-fpm.conf /opt/bref/etc/php-fpm.conf

ENV PHP_INI_SCAN_DIR="/opt/bref/etc/php/conf.d:/var/task/php/conf.d:/var/task/php/conf.dev.d"

EXPOSE 9001

# Clear the parent entrypoint
ENTRYPOINT []

# Run PHP-FPM
# opcache.validate_timestamps=1 : cancels the flag in the base configuration so that files are reloaded
CMD /opt/bin/php-fpm --nodaemonize --fpm-config /opt/bref/etc/php-fpm.conf -d opcache.validate_timestamps=1 --force-stderr

FROM bref/build-php-$PHP_VERSION as build_extensions

RUN pecl install xdebug
Expand All @@ -29,9 +13,19 @@ USER root
COPY --from=build_extensions /tmp/*.so /tmp/
RUN cp /tmp/*.so $(php -r "echo ini_get('extension_dir');")

FROM without_extensions
FROM bref/php-${PHP_VERSION}-fpm

COPY --from=build_dev /opt /opt

# Override the config so that PHP-FPM listens on port 9000
COPY php-fpm.conf /opt/bref/etc/php-fpm.conf

EXPOSE 9001

# Clear the parent entrypoint
ENTRYPOINT []

ENV PHP_INI_SCAN_DIR="/opt/bref/etc/php/conf.d:/var/task/php/conf.d:/var/task/php/conf.dev.d"

# Run PHP-FPM
# opcache.validate_timestamps=1 : cancels the flag in the base configuration so that files are reloaded
CMD /opt/bin/php-fpm --nodaemonize --fpm-config /opt/bref/etc/php-fpm.conf -d opcache.validate_timestamps=1 --force-stderr
2 changes: 1 addition & 1 deletion runtime/layers/tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
'bref/php-73-fpm-dev',
'bref/php-74-fpm-dev',
'bref/php-80-fpm-dev',
// 'bref/php-81-fpm-dev',
'bref/php-81-fpm-dev',
];
$devExtensions = [
'xdebug',
Expand Down

0 comments on commit c75867b

Please sign in to comment.