diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..872cf98 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,51 @@ +FROM php:8.3.29-fpm-alpine3.22 + +# Copier le php.ini personnalisé +COPY php.ini /usr/local/etc/php/php.ini + +# Installer les dépendances système et les outils de compilation +RUN apk update && apk add --no-cache \ + icu-dev libpng-dev libzip-dev mysql-client \ + pcre-dev ${PHPIZE_DEPS} \ + freetype-dev jpeg-dev libjpeg-turbo-dev \ + imagemagick imagemagick-dev \ + brotli-dev curl wget bash \ + && rm -rf /var/cache/apk/* + +# Configurer et installer les extensions PHP +RUN docker-php-ext-configure intl \ + && docker-php-ext-configure bcmath \ + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install -j$(nproc) \ + pdo_mysql intl zip gd bcmath pcntl exif + +# Installer toutes les extensions PECL et activer proprement +RUN pecl install apcu \ + && docker-php-ext-enable apcu + +RUN pecl install pcov \ + && docker-php-ext-enable pcov + +RUN pecl install swoole \ + && docker-php-ext-enable swoole + +RUN pecl install imagick \ + && docker-php-ext-enable imagick + + +# Installer Composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \ + && composer self-update --2 + +# Permissions temporaires +RUN chmod 777 -R /tmp/ + +# Créer l'utilisateur www-data avec UID 1000 +RUN deluser www-data \ + && adduser -DH -h /home/www-data -s /sbin/nologin -u 1000 www-data + +# Définir le répertoire de travail +WORKDIR /var/www/ + +# Commande par défaut +CMD ["php-fpm"] \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 2516fb7..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -# php-docker diff --git a/php56-fpm/config/php.ini b/php.ini similarity index 78% rename from php56-fpm/config/php.ini rename to php.ini index 446bcc7..b8db494 100644 --- a/php56-fpm/config/php.ini +++ b/php.ini @@ -15,9 +15,10 @@ date.timezone = "Europe/Paris" ; http://php.net/date.sunset-zenith ;date.sunset_zenith = 90.583333 -error_reporting=-1 +error_reporting=E_ALL & ~E_DEPRECATED display_errors = On -html_errors = 0 -display_startup_errors = On -log_errors = On -error_log = /dev/stderr +html_errors=On +display_startup_errors=On +log_errors=On +error_log=/dev/stderr + diff --git a/php55-apache/DockerFile b/php55-apache/DockerFile deleted file mode 100644 index 3c3e1d3..0000000 --- a/php55-apache/DockerFile +++ /dev/null @@ -1,31 +0,0 @@ -FROM php:5.5-apache - -# Install PDO MySQL driver -# See https://github.com/docker-library/php/issues/62 - -# Wheezy and Jessie were recently removed from the mirror network, so if you want to continue fetching Jessie backports, you need to use archive.debian.org instead: -# See https://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository -RUN echo "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list - -RUN apt-get update && apt-get install -y libicu-dev zlib1g-dev libpng-dev mysql-client wget - -RUN docker-php-ext-install pdo -RUN docker-php-ext-install pdo_mysql -RUN docker-php-ext-configure intl -RUN docker-php-ext-install intl -RUN docker-php-ext-install zip -RUN docker-php-ext-install gd - -RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer - -# Workaround for write permission on write to MacOS X volumes -# See https://github.com/boot2docker/boot2docker/pull/534 -RUN usermod -u 1000 www-data - -# Allow the rewriting engine -RUN a2enmod rewrite - -COPY config/php.ini /etc/php5/apache2/conf.d/php.ini -COPY config/php.ini /usr/local/etc/php/php.ini - -WORKDIR /var/www/html diff --git a/php55-apache/config/php.ini b/php55-apache/config/php.ini deleted file mode 100644 index 446bcc7..0000000 --- a/php55-apache/config/php.ini +++ /dev/null @@ -1,23 +0,0 @@ -[Date] -; Defines the default timezone used by the date functions -; http://php.net/date.timezone -date.timezone = "Europe/Paris" - -; http://php.net/date.default-latitude -;date.default_latitude = 31.7667 - -; http://php.net/date.default-longitude -;date.default_longitude = 35.2333 - -; http://php.net/date.sunrise-zenith -;date.sunrise_zenith = 90.583333 - -; http://php.net/date.sunset-zenith -;date.sunset_zenith = 90.583333 - -error_reporting=-1 -display_errors = On -html_errors = 0 -display_startup_errors = On -log_errors = On -error_log = /dev/stderr diff --git a/php56-fpm/DockerFile b/php56-fpm/DockerFile deleted file mode 100644 index eeedced..0000000 --- a/php56-fpm/DockerFile +++ /dev/null @@ -1,25 +0,0 @@ -FROM php:5.6-fpm - -# Install PDO MySQL driver -# See https://github.com/docker-library/php/issues/62 - - -RUN apt-get update && apt-get install -y libicu-dev zlib1g-dev libpng-dev git - -RUN docker-php-ext-install pdo -RUN docker-php-ext-install pdo_mysql -RUN docker-php-ext-configure intl -RUN docker-php-ext-install intl -RUN docker-php-ext-install zip -RUN docker-php-ext-install gd - -RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer - -# Workaround for write permission on write to MacOS X volumes -# See https://github.com/boot2docker/boot2docker/pull/534 -RUN usermod -u 1000 www-data - -COPY config/php.ini /etc/php5/apache2/conf.d/php.ini -COPY config/php.ini /usr/local/etc/php/php.ini - -WORKDIR /var/www diff --git a/php72-fpm/DockerFile b/php72-fpm/DockerFile deleted file mode 100644 index 7309a52..0000000 --- a/php72-fpm/DockerFile +++ /dev/null @@ -1,28 +0,0 @@ -FROM php:7.2-fpm-alpine3.9 - -# Install PDO MySQL driver -# See https://github.com/docker-library/php/issues/62 - -COPY config/php.ini /usr/local/etc/php/php.ini - -RUN echo "http://dl-3.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories - -RUN apk update --update && apk add --update --no-cache icu-dev libpng-dev mysql-client - -RUN docker-php-ext-install pdo_mysql -RUN docker-php-ext-configure intl -RUN docker-php-ext-install intl -RUN docker-php-ext-install zip -RUN docker-php-ext-install gd - - -RUN apk --no-cache add pcre-dev ${PHPIZE_DEPS} -# Install APCu -RUN pecl install apcu -RUN echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini - -RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer -RUN composer selfupdate -RUN chmod 777 -R /tmp/ - -WORKDIR /var/www/ diff --git a/php72-fpm/config/php.ini b/php72-fpm/config/php.ini deleted file mode 100644 index 18a2eb2..0000000 --- a/php72-fpm/config/php.ini +++ /dev/null @@ -1,23 +0,0 @@ -[Date] -; Defines the default timezone used by the date functions -; http://php.net/date.timezone -date.timezone = "Europe/Paris" - -; http://php.net/date.default-latitude -;date.default_latitude = 31.7667 - -; http://php.net/date.default-longitude -;date.default_longitude = 35.2333 - -; http://php.net/date.sunrise-zenith -;date.sunrise_zenith = 90.583333 - -; http://php.net/date.sunset-zenith -;date.sunset_zenith = 90.583333 - -error_reporting=-1 -display_errors = On -html_errors = On -display_startup_errors = On -log_errors = On -error_log = /dev/stderr diff --git a/php73-fpm/DockerFile b/php73-fpm/DockerFile deleted file mode 100755 index 5276e4b..0000000 --- a/php73-fpm/DockerFile +++ /dev/null @@ -1,28 +0,0 @@ -FROM php:7.3-fpm-alpine3.9 - -# Install PDO MySQL driver -# See https://github.com/docker-library/php/issues/62 - -COPY config/php.ini /usr/local/etc/php/php.ini - -RUN echo "http://dl-3.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories - -RUN apk update --update && apk add --update --no-cache icu-dev libpng-dev libzip-dev mysql-client - -RUN docker-php-ext-install pdo_mysql -RUN docker-php-ext-configure intl -RUN docker-php-ext-install intl -RUN docker-php-ext-install zip -RUN docker-php-ext-install gd - - -RUN apk --no-cache add pcre-dev ${PHPIZE_DEPS} -# Install APCu -RUN pecl install apcu -RUN echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini - -RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer -RUN composer selfupdate -RUN chmod 777 -R /tmp/ - -WORKDIR /var/www/ diff --git a/php73-fpm/config/php.ini b/php73-fpm/config/php.ini deleted file mode 100644 index 18a2eb2..0000000 --- a/php73-fpm/config/php.ini +++ /dev/null @@ -1,23 +0,0 @@ -[Date] -; Defines the default timezone used by the date functions -; http://php.net/date.timezone -date.timezone = "Europe/Paris" - -; http://php.net/date.default-latitude -;date.default_latitude = 31.7667 - -; http://php.net/date.default-longitude -;date.default_longitude = 35.2333 - -; http://php.net/date.sunrise-zenith -;date.sunrise_zenith = 90.583333 - -; http://php.net/date.sunset-zenith -;date.sunset_zenith = 90.583333 - -error_reporting=-1 -display_errors = On -html_errors = On -display_startup_errors = On -log_errors = On -error_log = /dev/stderr diff --git a/php74-fpm/DockerFile b/php74-fpm/DockerFile deleted file mode 100644 index ea88e22..0000000 --- a/php74-fpm/DockerFile +++ /dev/null @@ -1,28 +0,0 @@ -FROM php:7.4-rc-fpm-alpine3.10 - -# Install PDO MySQL driver -# See https://github.com/docker-library/php/issues/62 - -COPY config/php.ini /usr/local/etc/php/php.ini - -RUN echo "http://dl-3.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories - -RUN apk update --update && apk add --update --no-cache icu-dev libpng-dev libzip-dev mysql-client - -RUN docker-php-ext-install pdo_mysql -RUN docker-php-ext-configure intl -RUN docker-php-ext-install intl -RUN docker-php-ext-install zip -RUN docker-php-ext-install gd - - -RUN apk --no-cache add pcre-dev ${PHPIZE_DEPS} -# Install APCu -RUN pecl install apcu -RUN echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini - -RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer -RUN composer selfupdate -RUN chmod 777 -R /tmp/ - -WORKDIR /var/www/ diff --git a/php74-fpm/config/php.ini b/php74-fpm/config/php.ini deleted file mode 100644 index 18a2eb2..0000000 --- a/php74-fpm/config/php.ini +++ /dev/null @@ -1,23 +0,0 @@ -[Date] -; Defines the default timezone used by the date functions -; http://php.net/date.timezone -date.timezone = "Europe/Paris" - -; http://php.net/date.default-latitude -;date.default_latitude = 31.7667 - -; http://php.net/date.default-longitude -;date.default_longitude = 35.2333 - -; http://php.net/date.sunrise-zenith -;date.sunrise_zenith = 90.583333 - -; http://php.net/date.sunset-zenith -;date.sunset_zenith = 90.583333 - -error_reporting=-1 -display_errors = On -html_errors = On -display_startup_errors = On -log_errors = On -error_log = /dev/stderr