From 95800b3336c4d6a352e3e2c8e47eb0e8e02758df Mon Sep 17 00:00:00 2001 From: Jorge Arco Date: Fri, 21 Jul 2023 13:34:14 +0200 Subject: [PATCH] feat: 8.2 --- 8.2/Dockerfile | 83 +++++++++++++++++++ 8.2/devfs/etc/php82/conf.d/00_opcache.ini | 11 +++ 8.2/devfs/etc/php82/conf.d/00_xdebug.ini | 11 +++ 8.2/devfs/etc/php82/conf.d/50_settings.ini | 6 ++ 8.2/devfs/etc/profile | 19 +++++ .../etc/supervisord/conf.d/supervisord.conf | 13 +++ 8.2/rootfs/etc/php82/conf.d/00_opcache.ini | 11 +++ 8.2/rootfs/etc/php82/conf.d/50_settings.ini | 9 ++ 8.2/rootfs/etc/php82/php-fpm.conf | 36 ++++++++ makefile | 15 +--- 10 files changed, 202 insertions(+), 12 deletions(-) create mode 100644 8.2/Dockerfile create mode 100644 8.2/devfs/etc/php82/conf.d/00_opcache.ini create mode 100644 8.2/devfs/etc/php82/conf.d/00_xdebug.ini create mode 100644 8.2/devfs/etc/php82/conf.d/50_settings.ini create mode 100644 8.2/devfs/etc/profile create mode 100644 8.2/devfs/etc/supervisord/conf.d/supervisord.conf create mode 100644 8.2/rootfs/etc/php82/conf.d/00_opcache.ini create mode 100644 8.2/rootfs/etc/php82/conf.d/50_settings.ini create mode 100644 8.2/rootfs/etc/php82/php-fpm.conf diff --git a/8.2/Dockerfile b/8.2/Dockerfile new file mode 100644 index 0000000..3e0dec4 --- /dev/null +++ b/8.2/Dockerfile @@ -0,0 +1,83 @@ +FROM --platform=$BUILDPLATFORM alpine:edge as main + +LABEL maintainer="Jorge Arco " + +RUN apk --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/main add \ + icu-libs \ + && apk --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/community add \ + # Current packages don't exist in other repositories + libavif \ + gnu-libiconv \ + # Packages + tini \ + php82 \ + php82-dev \ + php82-common \ + php82-gd \ + php82-xmlreader \ + php82-bcmath \ + php82-ctype \ + php82-curl \ + php82-exif \ + php82-iconv \ + php82-intl \ + php82-mbstring \ + php82-opcache \ + php82-openssl \ + php82-pcntl \ + php82-phar \ + php82-session \ + php82-xml \ + php82-xsl \ + php82-zip \ + php82-zlib \ + php82-dom \ + php82-fpm \ + php82-sodium \ + php82-tokenizer \ + # Iconv Fix + php82-pecl-apcu \ + && ln -sf /usr/bin/php82 /usr/bin/php + +ADD rootfs / + +ENTRYPOINT ["/sbin/tini", "--"] + +CMD ["/usr/sbin/php-fpm82", "-R", "--nodaemonize"] + +EXPOSE 9000 + +WORKDIR /app + +FROM --platform=$BUILDPLATFORM main as dev + +ARG USER=root +ARG PASSWORD=root + +ARG COMPOSER_VERSION=2.5.1 + +RUN apk add -U --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \ + php82-pear \ + openssh \ + supervisor \ + autoconf \ + git \ + curl \ + wget \ + make \ + zip \ + php82-xdebug \ + # Delete APK cache. + && rm -rf /var/cache/apk/* \ + # Create ssh user for dev. + && sed -i s/#PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config \ + && echo "${USER}:${PASSWORD}" | chpasswd \ + && ssh-keygen -A \ + # Download composer. + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION} + +ADD devfs / + +CMD ["supervisord", "--nodaemon", "--configuration", "/etc/supervisord/conf.d/supervisord.conf"] + +EXPOSE 22 9003 diff --git a/8.2/devfs/etc/php82/conf.d/00_opcache.ini b/8.2/devfs/etc/php82/conf.d/00_opcache.ini new file mode 100644 index 0000000..ba5b4e0 --- /dev/null +++ b/8.2/devfs/etc/php82/conf.d/00_opcache.ini @@ -0,0 +1,11 @@ +zend_extension=opcache.so + +opcache.memory_consumption=256 +opcache.interned_strings_buffer=8 +opcache.max_accelerated_files=10000 +opcache.revalidate_freq=2 +opcache.fast_shutdown=1 +opcache.enable_cli=1 +opcache.enable=1 +opcache.validate_timestamps=1 +opcache.max_wasted_percentage=10 \ No newline at end of file diff --git a/8.2/devfs/etc/php82/conf.d/00_xdebug.ini b/8.2/devfs/etc/php82/conf.d/00_xdebug.ini new file mode 100644 index 0000000..c177230 --- /dev/null +++ b/8.2/devfs/etc/php82/conf.d/00_xdebug.ini @@ -0,0 +1,11 @@ +zend_extension=xdebug.so + +xdebug.mode=debug +xdebug.log_level=0 + +xdebug.start_with_request=yes +xdebug.client_host=${XDEBUG_CLIENT_HOST} +xdebug.max_nesting_level=250 + +xdebug.var_display_max_data=10000 +xdebug.var_display_max_depth=20 diff --git a/8.2/devfs/etc/php82/conf.d/50_settings.ini b/8.2/devfs/etc/php82/conf.d/50_settings.ini new file mode 100644 index 0000000..6aa39f3 --- /dev/null +++ b/8.2/devfs/etc/php82/conf.d/50_settings.ini @@ -0,0 +1,6 @@ +date.timezone = "UTC" +short_open_tag = Off +session.auto_start = Off +magic_quotes_gpc = Off +register_globals = Off +memory_limit = 1G diff --git a/8.2/devfs/etc/profile b/8.2/devfs/etc/profile new file mode 100644 index 0000000..af4ed5f --- /dev/null +++ b/8.2/devfs/etc/profile @@ -0,0 +1,19 @@ +export CHARSET=UTF-8 +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +export PAGER=less +export PS1='\h:\w\$ ' + +umask 022 + +alias xon='mv /tmp/00_xdebug.ini /etc/php82/conf.d/' +alias xoff='mv /etc/php82/conf.d/00_xdebug.ini /tmp' +alias opcon='mv /tmp/00_opcache.ini /etc/php82/conf.d/' +alias opcoff='mv /etc/php82/conf.d/00_opcache.ini /tmp' + +alias profile='XDEBUG_CONFIG="profiler_enable=1 xdebug.profiler_output_name=profiler.out.%p profiler_output_dir=." php' + +for script in /etc/profile.d/*.sh ; do + if [ -r $script ] ; then + . $script + fi +done diff --git a/8.2/devfs/etc/supervisord/conf.d/supervisord.conf b/8.2/devfs/etc/supervisord/conf.d/supervisord.conf new file mode 100644 index 0000000..ce20de9 --- /dev/null +++ b/8.2/devfs/etc/supervisord/conf.d/supervisord.conf @@ -0,0 +1,13 @@ +[supervisord] +nodaemon=true +logfile=/var/log/supervisord.log +pidfile=/var/run/supervisord.pid + +loglevel=debug +user=root + +[program:fpm] +command=/usr/sbin/php-fpm82 -R --nodaemonize + +[program:ssh] +command=/usr/sbin/sshd -D diff --git a/8.2/rootfs/etc/php82/conf.d/00_opcache.ini b/8.2/rootfs/etc/php82/conf.d/00_opcache.ini new file mode 100644 index 0000000..51d4740 --- /dev/null +++ b/8.2/rootfs/etc/php82/conf.d/00_opcache.ini @@ -0,0 +1,11 @@ +zend_extension=opcache.so + +opcache.memory_consumption=256 +opcache.interned_strings_buffer=8 +opcache.max_accelerated_files=50000 +opcache.revalidate_freq=60 +opcache.fast_shutdown=1 +opcache.enable_cli=1 +opcache.enable=1 +opcache.validate_timestamps=0 +opcache.max_wasted_percentage=10 diff --git a/8.2/rootfs/etc/php82/conf.d/50_settings.ini b/8.2/rootfs/etc/php82/conf.d/50_settings.ini new file mode 100644 index 0000000..a519614 --- /dev/null +++ b/8.2/rootfs/etc/php82/conf.d/50_settings.ini @@ -0,0 +1,9 @@ +date.timezone = "UTC" +short_open_tag = Off +session.auto_start = Off +magic_quotes_gpc = Off +register_globals = Off +memory_limit = 256M + +realpath_cache_size=4096K +realpath_cache_ttl=600 diff --git a/8.2/rootfs/etc/php82/php-fpm.conf b/8.2/rootfs/etc/php82/php-fpm.conf new file mode 100644 index 0000000..713c963 --- /dev/null +++ b/8.2/rootfs/etc/php82/php-fpm.conf @@ -0,0 +1,36 @@ +[global] +emergency_restart_threshold = 10 +emergency_restart_interval = 1m +process_control_timeout = 10 +error_log = /proc/self/fd/2 + +[www] +user = root +group = root +listen = [::]:9000 +chdir = /app + +access.log = /proc/self/fd/1 + +pm = dynamic +pm.max_children = 500 +pm.start_servers = 60 +pm.min_spare_servers = 25 +pm.max_spare_servers = 100 +pm.max_requests = 1000 + +listen.backlog = -1 +rlimit_files = 65536 +rlimit_core = unlimited +catch_workers_output = yes +decorate_workers_output = no + +request_slowlog_timeout = 5s +request_terminate_timeout = 120s +slowlog = /var/log/$pool.log.slow + +pm.status_path = /fpm_status +ping.path = /fpm_ping +ping.response = pong + +clear_env = no diff --git a/makefile b/makefile index a69ec43..a16aa08 100644 --- a/makefile +++ b/makefile @@ -33,21 +33,12 @@ release: docker buildx build --platform $(ARCHS) --push -t $(REPO):${SEMVER}-dev --target dev -f ${VERSION}/Dockerfile ${VERSION}/ test-all: test-all + VERSION=8.2 make build VERSION=8.1 make build VERSION=8.0 make build - VERSION=7.4 make build - VERSION=7.3 make build - VERSION=7.2 make build - VERSION=7.1 make build + VERSION=8.2 make test-main VERSION=8.1 make test-main VERSION=8.0 make test-main - VERSION=7.4 make test-main - VERSION=7.3 make test-main - VERSION=7.2 make test-main - VERSION=7.1 make test-main + VERSION=8.2 make test-dev VERSION=8.1 make test-dev VERSION=8.0 make test-dev - VERSION=7.4 make test-dev - VERSION=7.3 make test-dev - VERSION=7.2 make test-dev - VERSION=7.1 make test-dev