Skip to content

Commit e34ca2f

Browse files
committed
refactor: simplify Dockerfile ARG variables and comment out problematic extensions for PHP 8.3
1 parent 4dcead2 commit e34ca2f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docker/php/Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# docker/php/Dockerfile
2-
ARG PHP_VERSION=8.4
3-
ARG PHP_TARGET=dev
2+
ARG PHP_VERSION
43

54
# Base PHP image with essential extensions
65
FROM php:${PHP_VERSION}-fpm AS php-base
@@ -57,6 +56,8 @@ RUN apt-get remove -y g++ \
5756
# Set working directory
5857
WORKDIR /var/www/html
5958

59+
ARG PHP_TARGET
60+
6061
# If building for development, add development extensions
6162
RUN if [ "$PHP_TARGET" = "dev" ]; then \
6263
apt-get update && apt-get install -y \
@@ -84,24 +85,23 @@ RUN if [ "$PHP_TARGET" = "dev" ]; then \
8485
sockets \
8586
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
8687
&& docker-php-ext-install -j$(nproc) imap \
88+
# && pecl install imagick && docker-php-ext-enable imagick \
8789
&& docker-php-ext-configure ldap \
8890
&& docker-php-ext-install ldap \
8991
&& pecl install xdebug && docker-php-ext-enable xdebug \
9092
&& pecl install memcached && docker-php-ext-enable memcached \
9193
&& pecl install mongodb && docker-php-ext-enable mongodb \
9294
&& pecl install redis && docker-php-ext-enable redis \
93-
&& yes '' | pecl install imagick && docker-php-ext-enable imagick \
9495
&& docker-php-source delete \
9596
&& apt-get remove -y wget \
9697
&& apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y \
9798
&& rm -rf /var/lib/apt/lists/* \
98-
&& rm -rf /tmp/* /var/tmp/*; \
99-
# Configuration for Xdebug
100-
{ \
101-
echo 'xdebug.mode=develop,debug'; \
102-
echo 'xdebug.client_host=host.docker.internal'; \
103-
echo 'xdebug.start_with_request=yes'; \
104-
} > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
99+
&& rm -rf /tmp/* /var/tmp/* \
100+
&& echo 'xdebug.mode=develop,debug' > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
101+
&& echo 'xdebug.client_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
102+
&& echo 'xdebug.start_with_request=yes' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini ; \
103+
else \
104+
echo "Building production image without development tools."; \
105105
fi
106106

107107
# Default command

0 commit comments

Comments
 (0)