Skip to content

Commit

Permalink
Merge pull request #1071 from markshust/feature/php83
Browse files Browse the repository at this point in the history
  • Loading branch information
markshust authored Feb 25, 2024
2 parents 9d212e1 + 0bee21f commit 72415f5
Show file tree
Hide file tree
Showing 13 changed files with 641 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-php-8-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
push: true
tags: |
markoshust/magento-php:8.1-fpm
markoshust/magento-php:8.1-fpm-1
markoshust/magento-php:8.1-fpm-2
2 changes: 1 addition & 1 deletion .github/workflows/build-php-8-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
push: true
tags: |
markoshust/magento-php:8.2-fpm
markoshust/magento-php:8.2-fpm-0
markoshust/magento-php:8.2-fpm-1
34 changes: 34 additions & 0 deletions .github/workflows/build-php-8-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: build-php-8-3

on: workflow_dispatch

jobs:
php-8-3:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: images/php/8.3
platforms: linux/amd64,linux/arm64
push: true
tags: |
markoshust/magento-php:8.3-fpm
markoshust/magento-php:8.3-fpm-develop
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ View Dockerfiles for the latest tags:
- [markoshust/magento-nginx (Docker Hub)](https://hub.docker.com/r/markoshust/magento-nginx/)
- [`1.18`, `1.18-8`](images/nginx/1.18)
- [markoshust/magento-php (Docker Hub)](https://hub.docker.com/r/markoshust/magento-php/)
- [`8.1-fpm`, `8.1-fpm-1`](images/php/8.1)
- [`8.2-fpm`, `8.2-fpm-0`](images/php/8.2)
- [`8.1-fpm`, `8.1-fpm-2`](images/php/8.1)
- [`8.2-fpm`, `8.2-fpm-1`](images/php/8.2)
- [`8.3-fpm`, `8.3-fpm-develop`](images/php/8.3)
- [markoshust/magento-opensearch (Docker Hub)](https://hub.docker.com/r/markoshust/magento-opensearch/)
- [`1.2`, `1.2-0`](images/opensearch/1.2)
- [`2.5`, `2.5-1`](images/opensearch/2.5)
Expand Down
8 changes: 4 additions & 4 deletions images/php/8.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-fpm-bullseye
FROM php:8.1-fpm-bookworm
MAINTAINER Mark Shust <[email protected]>

ARG APP_ID=1000
Expand Down Expand Up @@ -41,10 +41,10 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*

RUN pecl channel-update pecl.php.net && pecl install \
imagick \
redis \
imagick-3.7.0 \
redis-6.0.2 \
ssh2-1.3.1 \
xdebug \
xdebug-3.3.1 \
&& pecl clear-cache \
&& rm -rf /tmp/pear

Expand Down
10 changes: 5 additions & 5 deletions images/php/8.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2-fpm-bullseye
FROM php:8.2-fpm-bookworm
MAINTAINER Mark Shust <[email protected]>

ARG APP_ID=1000
Expand All @@ -8,7 +8,7 @@ RUN groupadd -g "$APP_ID" app \
RUN mkdir -p /etc/nginx/html /var/www/html /sock \
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock

RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -

RUN apt-get update && apt-get install -y \
cron \
Expand Down Expand Up @@ -41,10 +41,10 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*

RUN pecl channel-update pecl.php.net && pecl install \
imagick \
redis \
imagick-3.7.0 \
redis-6.0.2 \
ssh2-1.3.1 \
xdebug \
xdebug-3.3.1 \
&& pecl clear-cache \
&& rm -rf /tmp/pear

Expand Down
118 changes: 118 additions & 0 deletions images/php/8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
FROM php:8.3-fpm-bookworm
MAINTAINER Mark Shust <[email protected]>

ARG APP_ID=1000
RUN groupadd -g "$APP_ID" app \
&& useradd -g "$APP_ID" -u "$APP_ID" -d /var/www -s /bin/bash app

RUN mkdir -p /etc/nginx/html /var/www/html /sock \
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock

RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -

RUN apt-get update && apt-get install -y \
cron \
default-mysql-client \
git \
gnupg \
gzip \
libbz2-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libmagickwand-dev \
libmcrypt-dev \
libonig-dev \
libpng-dev \
libsodium-dev \
libssh2-1-dev \
libwebp-dev \
libxslt1-dev \
libzip-dev \
lsof \
mailutils \
msmtp \
nodejs \
procps \
strace \
vim \
zip \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN pecl channel-update pecl.php.net && pecl install \
redis-6.0.2 \
ssh2-1.3.1 \
xdebug-3.3.1 \
&& pecl clear-cache \
&& rm -rf /tmp/pear

RUN curl -L https://github.com/Imagick/imagick/archive/28f27044e435a2b203e32675e942eb8de620ee58.zip -o imagick.zip \
&& unzip imagick.zip \
&& rm imagick.zip \
&& cd imagick-28f27044e435a2b203e32675e942eb8de620ee58 \
&& phpize \
&& ./configure --with-php-config=/usr/local/bin/php-config \
&& make \
&& make install \
&& echo "extension=imagick.so" >> $PHP_INI_DIR/conf.d/imagick.ini \
&& cd .. \
&& rm -rf imagick-master

RUN docker-php-ext-configure \
gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install \
bcmath \
bz2 \
calendar \
exif \
gd \
gettext \
intl \
mbstring \
mysqli \
opcache \
pcntl \
pdo_mysql \
soap \
sockets \
sodium \
sysvmsg \
sysvsem \
sysvshm \
xsl \
zip \
&& docker-php-ext-enable \
imagick \
redis \
ssh2 \
xdebug

RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& architecture=$(uname -m) \
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \
&& mkdir -p /tmp/blackfire \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz

RUN git clone --branch v0.4.15 --depth=1 https://github.com/NoiseByNorthwest/php-spx.git /usr/lib/php-spx \
&& cd /usr/lib/php-spx \
&& phpize \
&& ./configure \
&& make \
&& make install

RUN curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/local/bin --filename=composer

COPY conf/blackfire.ini $PHP_INI_DIR/conf.d/blackfire.ini
COPY conf/spx.ini $PHP_INI_DIR/conf.d/spx.ini
COPY conf/msmtprc /etc/msmtprc
COPY conf/php.ini $PHP_INI_DIR
COPY conf/php-fpm.conf /usr/local/etc/
COPY conf/www.conf /usr/local/etc/php-fpm.d/

USER app:app
VOLUME /var/www
WORKDIR /var/www/html
2 changes: 2 additions & 0 deletions images/php/8.3/conf/blackfire.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extension=blackfire.so
blackfire.agent_socket=tcp://blackfire:8307
4 changes: 4 additions & 0 deletions images/php/8.3/conf/msmtprc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
account default
host mailcatcher
port 1025
from "[email protected]"
34 changes: 34 additions & 0 deletions images/php/8.3/conf/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
; This file was initially adapated from the output of: (on PHP 5.6)
; grep -vE '^;|^ *$' /usr/local/etc/php-fpm.conf.default

[global]

error_log = /proc/self/fd/2
daemonize = no

[www]

; if we send this to /proc/self/fd/1, it never appears
access.log = /proc/self/fd/2

;user = app
;group = app

listen = /sock/docker.sock
listen.owner = app
listen.group = app
listen.mode = 0660

pm = dynamic
pm.max_children = 10
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 6

clear_env = no

; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes

; This needed to make PHP-SPX work in fpm mode.
process.dumpable = yes
15 changes: 15 additions & 0 deletions images/php/8.3/conf/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
memory_limit = 4G
max_execution_time = 1800
zlib.output_compression = 1
cgi.fix_pathinfo = 0
date.timezone = UTC

xdebug.mode = off
xdebug.client_host = host.docker.internal
xdebug.idekey = PHPSTORM

upload_max_filesize = 100M
post_max_size = 100M
max_input_vars = 10000

sendmail_path = "/usr/bin/msmtp -t"
7 changes: 7 additions & 0 deletions images/php/8.3/conf/spx.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
zlib.output_compression = 0

extension = /usr/lib/php-spx/modules/spx.so
spx.http_enabled = 1
spx.http_key = "dev"
spx.http_ip_whitelist = "*"
spx.data_dir = /var/www/spx_dumps
Loading

0 comments on commit 72415f5

Please sign in to comment.