|
1 | 1 | # docker/php/Dockerfile |
2 | | -ARG PHP_VERSION=8.4 |
3 | | -ARG PHP_TARGET=dev |
| 2 | +ARG PHP_VERSION |
4 | 3 |
|
5 | 4 | # Base PHP image with essential extensions |
6 | 5 | FROM php:${PHP_VERSION}-fpm AS php-base |
@@ -57,6 +56,8 @@ RUN apt-get remove -y g++ \ |
57 | 56 | # Set working directory |
58 | 57 | WORKDIR /var/www/html |
59 | 58 |
|
| 59 | +ARG PHP_TARGET |
| 60 | + |
60 | 61 | # If building for development, add development extensions |
61 | 62 | RUN if [ "$PHP_TARGET" = "dev" ]; then \ |
62 | 63 | apt-get update && apt-get install -y \ |
@@ -84,24 +85,23 @@ RUN if [ "$PHP_TARGET" = "dev" ]; then \ |
84 | 85 | sockets \ |
85 | 86 | && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ |
86 | 87 | && docker-php-ext-install -j$(nproc) imap \ |
| 88 | + # && pecl install imagick && docker-php-ext-enable imagick \ |
87 | 89 | && docker-php-ext-configure ldap \ |
88 | 90 | && docker-php-ext-install ldap \ |
89 | 91 | && pecl install xdebug && docker-php-ext-enable xdebug \ |
90 | 92 | && pecl install memcached && docker-php-ext-enable memcached \ |
91 | 93 | && pecl install mongodb && docker-php-ext-enable mongodb \ |
92 | 94 | && pecl install redis && docker-php-ext-enable redis \ |
93 | | - && yes '' | pecl install imagick && docker-php-ext-enable imagick \ |
94 | 95 | && docker-php-source delete \ |
95 | 96 | && apt-get remove -y wget \ |
96 | 97 | && apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y \ |
97 | 98 | && 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."; \ |
105 | 105 | fi |
106 | 106 |
|
107 | 107 | # Default command |
|
0 commit comments