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
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ updates:
reviewers:
- mrrobot47

- package-ecosystem: "docker"
directory: "/php/8.6"
ignore:
- dependency-name: "php"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
schedule:
interval: "weekly"
reviewers:
- mrrobot47

- package-ecosystem: "docker"
directory: "/php/stable"
ignore:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
php: ['8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
steps:
- name: Checkout
uses: actions/checkout@v7
Expand Down
159 changes: 159 additions & 0 deletions php/8.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
FROM php:8.6.0-fpm

LABEL maintainer="Riddhesh Sanghvi <[email protected]>"
LABEL org.label-schema.schema-version="1.0.0"
LABEL org.label-schema.vendor="EasyEngine"
LABEL org.label-schema.name="php"

RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
imagemagick \
less \
mariadb-client msmtp \
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
libfreetype6-dev \
libjpeg-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libmagickwand-dev \
libgraphicsmagick1-dev \
libmcrypt-dev \
libicu-dev \
libmemcached-dev \
libonig-dev \
libxml2-dev \
libpng-dev \
libzip-dev \
libssl-dev \
libgmp-dev \
tmux \
unzip \
vim \
zip

# imap is left out until it builds on 8.6, so its libc-client-dev from sury isn't needed.
#RUN curl -fsSL https://packages.sury.org/php/README.txt | bash && \
# apt-get update && \
# apt-get install -y libc-client-dev

# The 8.6 base image has no pecl (docker-library/php#1654), so extensions are built from source tarballs.
# The latest PECL releases of memcached, redis and apcu don't build on 8.6 yet; their upstream fixes are pinned instead.
RUN set -eux; \
docker-php-source extract; \
fetch_ext() { mkdir -p "/usr/src/php/ext/$1"; curl -fsSL "$2" | tar -xz -C "/usr/src/php/ext/$1" --strip-components=1; }; \
fetch_ext memcached https://github.com/php-memcached-dev/php-memcached/archive/0b52d3657140750fa0eddd20cdbfc6edc8fbdadd.tar.gz; \
fetch_ext redis https://github.com/phpredis/phpredis/archive/5b60b125aba347159b0c9c319296fbb3c5ed9214.tar.gz; \
fetch_ext apcu https://github.com/krakjoe/apcu/archive/fb2c942552a3f5dab7f4dea4afb5cf0831222c57.tar.gz; \
fetch_ext timezonedb https://pecl.php.net/get/timezonedb; \
docker-php-ext-install memcached; \
docker-php-ext-install redis; \
docker-php-ext-install apcu; \
docker-php-ext-install timezonedb; \
# mcrypt and imap don't build on 8.6 yet, even from their upstream heads.
# fetch_ext mcrypt https://pecl.php.net/get/mcrypt; \
# docker-php-ext-install mcrypt; \
# fetch_ext imap https://pecl.php.net/get/imap; \
# docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
# docker-php-ext-install imap; \
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \
docker-php-ext-configure zip; \
docker-php-ext-install gd; \
docker-php-ext-install mysqli; \
docker-php-ext-install pdo_mysql; \
docker-php-ext-install soap; \
docker-php-ext-install intl; \
docker-php-ext-install zip; \
docker-php-ext-install exif; \
docker-php-ext-install calendar; \
docker-php-ext-install gmp; \
docker-php-ext-install pcntl; \
docker-php-ext-install shmop; \
docker-php-ext-install sockets; \
docker-php-ext-install sysvsem; \
docker-php-ext-install sysvshm; \
docker-php-ext-install bcmath; \
# No longer built into the base image as of 8.6.
docker-php-ext-install mbstring; \
docker-php-source delete; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*;

# Temp workaround for imagick
RUN apt update && apt install -y git --no-install-recommends && \
git clone https://github.com/Imagick/imagick.git --depth 1 /tmp/imagick && \
cd /tmp/imagick && \
git fetch origin master && \
git switch master && \
cd /tmp/imagick && \
phpize && \
./configure && \
make && \
make install && \
docker-php-ext-enable imagick && \
apt remove -y git && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/imagick

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

# Donwload and install composer
RUN curl -sSL "https://getcomposer.org/installer" | php \
&& mv composer.phar /usr/local/bin/composer

# Install wp-cli
RUN curl -O "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar" \
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp

# Setup a config file
RUN mkdir -p /etc/wp-cli
RUN { \
echo 'path: /var/www/htdocs'; \
} > /etc/wp-cli/config.yml

RUN mkdir /usr/local/etc/misc && \
touch /usr/local/etc/misc/msmtprc && \
ln -s /usr/local/etc/misc/msmtprc /etc/msmtprc && \
chown www-data:www-data /usr/local/etc/misc/msmtprc && \
chown www-data:www-data /etc/msmtprc

#RUN latest_build=$(curl -s https://download.newrelic.com/php_agent/release/ | grep 'linux\.tar\.gz"' | head -n 1 | sed 's/.*"\(.*\)".*/\1/') && \
#curl -L "https://download.newrelic.com$latest_build" | tar -C /tmp -zx && \
#export NR_INSTALL_USE_CP_NOT_LN=1 && \
#export NR_INSTALL_SILENT=1 && \
#/tmp/newrelic-php5-*/newrelic-install install && \
#rm -rf /tmp/newrelic-php5-* /tmp/nrinstall*
#
#ENV NR_PORT=/run/newrelic/newrelic.sock

# Setup logs
RUN mkdir -p /var/log/php; \
chown -R www-data: /var/log/php; \
rm /usr/local/etc/php-fpm.d/*;
COPY php.ini /usr/local/etc/php/php.ini
COPY easyengine.conf /usr/local/etc/php-fpm.d/easyengine.conf

COPY expose_off.ini /usr/local/etc/php/conf.d/expose_off.ini
COPY bashrc /root/.bashrc
COPY bashrc /var/www/.bashrc
COPY docker-entrypoint.sh /usr/local/bin/
#COPY newrelic.ini /usr/local/etc/php/conf.d/newrelic.ini
#COPY newrelic.ini /data/newrelic.ini

WORKDIR /var/www/htdocs
RUN usermod -s /bin/bash www-data
USER www-data

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["php-fpm"]
2 changes: 2 additions & 0 deletions php/8.6/bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PS1="\`if [ \$? = 0 ]; then echo \[\e[37m\]^_^[\u@$VIRTUAL_HOST:\w]\\$ \[\e[0m\]; else echo \[\e[31m\]O_O[\u@$VIRTUAL_HOST:\w]\\$ \[\e[0m\]; fi\`"
export HISTTIMEFORMAT="%d/%m/%y %T "
12 changes: 12 additions & 0 deletions php/8.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail -o nounset

#if [[ -z "${NEWRELIC_LICENSE_KEY:-}" ]] || [[ -z "${NEWRELIC_APPNAME:-}" ]]; then
# :
#else
# sed -i -e "s/\"REPLACE_WITH_REAL_KEY\"/\"$NEWRELIC_LICENSE_KEY\"/" \
# -e "s/newrelic.appname = \"PHP Application\"/newrelic.appname = \"$NEWRELIC_APPNAME\"/" \
# /usr/local/etc/php/conf.d/newrelic.ini
#fi

exec "$@"
20 changes: 20 additions & 0 deletions php/8.6/easyengine.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[global]
error_log = /var/log/php/error.log
daemonize = no

[www]
ping.path = /ee-admin/ping
pm.status_path = /ee-admin/status
request_terminate_timeout = 300
user = www-data
group = www-data
pm = ondemand
pm.max_children = 20
listen = 9000
; if we send this to /proc/self/fd/1, it never appears
access.log = /var/log/php/access.log

clear_env = no

; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes
56 changes: 56 additions & 0 deletions php/8.6/expected-modules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apcu
bcmath
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
gd
gmp
hash
iconv
imagick
intl
json
lexbor
libxml
mbstring
memcached
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
random
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvsem
sysvshm
timezonedb
tokenizer
uri
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
1 change: 1 addition & 0 deletions php/8.6/expose_off.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
expose_php = Off
18 changes: 18 additions & 0 deletions php/8.6/newrelic.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; This file contains the various settings for the New Relic PHP agent. There
; are many options, all of which are described in detail at the following URL:
; https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration
;

extension = "newrelic.so"

[newrelic]
newrelic.license = "REPLACE_WITH_REAL_KEY"
newrelic.appname = "PHP Application"
newrelic.logfile = "/var/log/newrelic/php_agent.log"
newrelic.daemon.logfile = "/var/log/newrelic/newrelic-daemon.log"
newrelic.daemon.port = "/run/newrelic/newrelic.sock"
newrelic.transaction_tracer.record_sql = "raw"
newrelic.transaction_tracer.threshold = "1s"
newrelic.browser_monitoring.auto_instrument = 0
newrelic.application_logging.forwarding.log_level = error
newrelic.daemon.dont_launch = 3
Loading