Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ publish-docker-images: docker-images
"bref/php-73" "bref/php-73-fpm" "bref/php-73-console" "bref/php-73-fpm-dev" \
"bref/php-74" "bref/php-74-fpm" "bref/php-74-console" "bref/php-74-fpm-dev" \
"bref/php-80" "bref/php-80-fpm" "bref/php-80-console" "bref/php-80-fpm-dev" \
"bref/php-81" "bref/php-81-fpm" "bref/php-81-console" "bref/php-81-fpm-dev" \
"bref/build-php-73" \
"bref/build-php-74" \
"bref/build-php-80" \
"bref/build-php-81" \
"bref/fpm-dev-gateway"; \
do \
docker image tag $$image:latest $$image:${DOCKER_TAG} ; \
Expand Down
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 . # xdebug not ok
cd layers/fpm-dev ; docker build -t bref/php-81-fpm-dev --build-arg PHP_VERSION=81 --target=without_extensions .
cd layers/web; docker build -t bref/fpm-dev-gateway .
# Run tests
php layers/tests.php
29 changes: 16 additions & 13 deletions runtime/layers/fpm-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
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

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"

FROM bref/build-php-$PHP_VERSION as build_extensions

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

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

FROM without_extensions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the new FROM here? We would lose the EXPOSE, ENV and everything defined above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked, ENV, EXPOSE, CMD & ENTRYPOINT will be inherited from the above, the only difference is that we won't copy extensions (xdebug, blackfire).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh I think I see it now, thank you!


COPY --from=build_dev /opt /opt
4 changes: 2 additions & 2 deletions runtime/layers/tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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',
];
foreach ($allLayers as $layer) {
// Working directory
Expand Down Expand Up @@ -51,7 +51,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',
];
foreach ($fpmLayers as $layer) {
// PHP-FPM is installed
Expand Down