From 2f13e6435e478411785f5263c93a42f89b623bf6 Mon Sep 17 00:00:00 2001 From: shinsenter <2082119+shinsenter@users.noreply.github.com> Date: Mon, 29 Aug 2022 11:02:24 +0900 Subject: [PATCH] Use S6 Overlay v3.1.2.0 --- .bin/tidy-docker | 2 +- .github/workflows/build-v2.yml | 10 ++++--- CHANGELOG.md | 24 +++++++++++++---- README.md | 1 + S6_VERSIONS | 7 ++--- SPONSOR.md | 19 ++++++++++---- src/base-ubuntu/root/usr/bin/cleanup | 4 +-- src/php/cli/Dockerfile | 1 - src/php/cli/php7.3.txt | 3 +++ src/php/cli/php7.4.txt | 3 +++ src/php/cli/php8.0.txt | 3 +++ src/php/cli/php8.1.txt | 3 +++ src/php/cli/php8.2.txt | 9 +++---- src/php/cli/php9.0.txt | 3 +++ .../root/etc/cont-init.d/200-composer-home | 1 - src/php/fpm/Dockerfile | 13 ++++++++-- .../fuelphp/root/startup/500-init-fuelphp | 4 ++- src/webapps/kirby/root/startup/500-init-kirby | 5 ++-- src/webapps/slim/root/startup/500-init-slim | 4 ++- src/webapps/wordpress/Dockerfile | 23 +++++++++++++++- src/webapps/wordpress/README.md | 26 +++++++++++++++++++ .../wordpress/root/etc/docker-wordpress.php | 23 ++++++++++++++++ .../wordpress/root/startup/500-init-wordpress | 4 +++ src/webapps/yii/root/startup/500-init-yii | 4 ++- tests/docker-compose.webapps.yml | 6 +++++ tests/test.sh | 2 +- 26 files changed, 171 insertions(+), 36 deletions(-) create mode 100644 src/webapps/wordpress/root/etc/docker-wordpress.php diff --git a/.bin/tidy-docker b/.bin/tidy-docker index b4b2e37c..5161d963 100755 --- a/.bin/tidy-docker +++ b/.bin/tidy-docker @@ -144,7 +144,7 @@ RUN [ -x "\$(command -v find)" ] && find / \( \\ -or -name "*pip*" -or -name "*__pycache__*" \\ -or -name "*easy_install*" -or -name "*dist-info*" \\ \) ! -path "/sys/*" ! -path "/proc/*" \\ - -exec rm -rf {} + || true + | xargs rm -rf || true ################################################################################ # BUILDING OPTIMIZED IMAGE FROM SCRATCH. ##################################### FROM scratch diff --git a/.github/workflows/build-v2.yml b/.github/workflows/build-v2.yml index a9ef16c7..69433f05 100644 --- a/.github/workflows/build-v2.yml +++ b/.github/workflows/build-v2.yml @@ -205,10 +205,11 @@ jobs: - 22.04 - 20.04 s6_version: - - v3.1.1.2 - - v3.1.1.1 - - v3.1.1.0 - v3.1.0.1 + - v3.1.1.0 + - v3.1.1.1 + - v3.1.1.2 + - v3.1.2.0 env: DOCKER_BUILDKIT: "1" steps: @@ -301,6 +302,7 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" env: DOCKER_BUILDKIT: "1" steps: @@ -424,6 +426,7 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" variation: - fpm-apache - fpm-nginx @@ -539,6 +542,7 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" app: - cakephp4 - codeigniter4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 19b7e7a8..543690a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2.3.0 - 2022-08-29 + +Use [S6 Overlay v3.1.2.0](https://github.com/just-containers/s6-overlay/releases/tag/v3.1.2.0). + + ## 2.2.0 - 2022-07-01 Use [S6 Overlay v3.1.1.2](https://github.com/just-containers/s6-overlay/releases/tag/v3.1.1.2). @@ -163,25 +168,34 @@ Docker images for PHP applications, from CLI to standalone web server. --- + + ## Community -As an open source project, we'd appreciate any help and contributions! +As an open-source project, we'd appreciate any help and contributions! [![Become a stargazer](https://img.shields.io/badge/Become-Stargazer-yellow)](https://code.shin.company/php/stargazers) [![Report an issue](https://img.shields.io/badge/New-Discussions-green)](https://code.shin.company/php/discussions/new) [![Join us on Gitter](https://badges.gitter.im/shinsenter/php.svg)](https://gitter.im/shinsenter/php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join us on Discord](https://img.shields.io/discord/962919929307357234?color=blueviolet)](https://discord.com/channels/962919929307357234/962920416559652924) -We follow the standard [github pull request process](https://help.github.com/articles/about-pull-requests). It is appreciated when you [report an issue](https://code.shin.company/php/issues/new/choose) or event [start a discussion](https://code.shin.company/php/discussions/new). We'll try to review your contributions as soon as possible. +We should follow the standard [Github pull request process](https://help.github.com/articles/about-pull-requests). I'll try to review your contributions as soon as possible. + -Not ready to contribute code, but see something that needs work? From contributing to source code to improving readability of the documentation, all suggestions are welcome! +It is also appreciated when you [report an issue](https://code.shin.company/php/issues/new/choose) or [open a discussion](https://code.shin.company/php/discussions/new). + +Not ready to contribute code, but see something that needs work? From contributing to source code to improving the readability of the documentation, all suggestions are welcome! + +> [NEED HELP] Please help me [improve the documentation and examples](https://code.shin.company/php/edit/main/README.md). + +* * * ## Support my activities If you like this repository, please [become a stargazer](https://code.shin.company/php/stargazers) on my Github or join Gitter to follow further updates. -I also love to have your help, please consider buying me a coffee, or sponsoring my works so I can create more helpful stuffs 😉. +I also love to have your help, please consider [buying me a coffee](https://www.paypal.me/shinsenter), or sponsoring my work so I can create more helpful pieces of stuff 😉. [![Donate via PayPal](https://img.shields.io/badge/Donate-Paypal-blue)](https://www.paypal.me/shinsenter) [![Become a sponsor](https://img.shields.io/badge/Donate-Patreon-orange)](https://www.patreon.com/appseeds) -I really appreciate your love and supports. +I appreciate your love and support. * * * diff --git a/README.md b/README.md index 4e22805a..96537e72 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ These images are actively maintained. - [![`shinsenter/php:7.4`](https://img.shields.io/docker/image-size/shinsenter/php/7.4?label=shinsenter%2Fphp%3A7.4)](https://docker.shin.company/php/tags?page=1&name=7.4) - [![`shinsenter/php:8.0`](https://img.shields.io/docker/image-size/shinsenter/php/8.0?label=shinsenter%2Fphp%3A8.0)](https://docker.shin.company/php/tags?page=1&name=8.0) - [![`shinsenter/php:8.1`](https://img.shields.io/docker/image-size/shinsenter/php/8.1?label=shinsenter%2Fphp%3A8.1)](https://docker.shin.company/php/tags?page=1&name=8.1) +- [![`shinsenter/php:8.2` (beta)](https://img.shields.io/docker/image-size/shinsenter/php/8.2?label=shinsenter%2Fphp%3A8.2%20%28beta%29)](https://docker.shin.company/php/tags?page=1&name=8.2) ### PHP-CLI diff --git a/S6_VERSIONS b/S6_VERSIONS index 4e9ffce7..2d7efade 100644 --- a/S6_VERSIONS +++ b/S6_VERSIONS @@ -1,4 +1,5 @@ -v3.1.1.2 -v3.1.1.1 -v3.1.1.0 v3.1.0.1 +v3.1.1.0 +v3.1.1.1 +v3.1.1.2 +v3.1.2.0 diff --git a/SPONSOR.md b/SPONSOR.md index 72bb0b89..ba20e3a2 100644 --- a/SPONSOR.md +++ b/SPONSOR.md @@ -1,24 +1,33 @@ +* * * + ## Community -As an open source project, we'd appreciate any help and contributions! +As an open-source project, we'd appreciate any help and contributions! [![Become a stargazer](https://img.shields.io/badge/Become-Stargazer-yellow)](https://code.shin.company/php/stargazers) [![Report an issue](https://img.shields.io/badge/New-Discussions-green)](https://code.shin.company/php/discussions/new) [![Join us on Gitter](https://badges.gitter.im/shinsenter/php.svg)](https://gitter.im/shinsenter/php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join us on Discord](https://img.shields.io/discord/962919929307357234?color=blueviolet)](https://discord.com/channels/962919929307357234/962920416559652924) -We follow the standard [github pull request process](https://help.github.com/articles/about-pull-requests). It is appreciated when you [report an issue](https://code.shin.company/php/issues/new/choose) or event [start a discussion](https://code.shin.company/php/discussions/new). We'll try to review your contributions as soon as possible. +We should follow the standard [Github pull request process](https://help.github.com/articles/about-pull-requests). I'll try to review your contributions as soon as possible. + + +It is also appreciated when you [report an issue](https://code.shin.company/php/issues/new/choose) or [open a discussion](https://code.shin.company/php/discussions/new). -Not ready to contribute code, but see something that needs work? From contributing to source code to improving readability of the documentation, all suggestions are welcome! +Not ready to contribute code, but see something that needs work? From contributing to source code to improving the readability of the documentation, all suggestions are welcome! + +> [NEED HELP] Please help me [improve the documentation and examples](https://code.shin.company/php/edit/main/README.md). + +* * * ## Support my activities If you like this repository, please [become a stargazer](https://code.shin.company/php/stargazers) on my Github or join Gitter to follow further updates. -I also love to have your help, please consider buying me a coffee, or sponsoring my works so I can create more helpful stuffs 😉. +I also love to have your help, please consider [buying me a coffee](https://www.paypal.me/shinsenter), or sponsoring my work so I can create more helpful pieces of stuff 😉. [![Donate via PayPal](https://img.shields.io/badge/Donate-Paypal-blue)](https://www.paypal.me/shinsenter) [![Become a sponsor](https://img.shields.io/badge/Donate-Patreon-orange)](https://www.patreon.com/appseeds) -I really appreciate your love and supports. +I appreciate your love and support. * * * diff --git a/src/base-ubuntu/root/usr/bin/cleanup b/src/base-ubuntu/root/usr/bin/cleanup index 9e7770c6..f5aaa551 100755 --- a/src/base-ubuntu/root/usr/bin/cleanup +++ b/src/base-ubuntu/root/usr/bin/cleanup @@ -3,8 +3,8 @@ [ -x "$(command -v composer)" ] && composer clearcache || true [ -x "$(command -v npm)" ] && npm cache clean --force || true [ ! -x "$(command -v vim)" ] && rm -rf /usr/share/vim || true -find /etc/ -type f -name '*-' -or -name '.placeholder' -delete 2>/dev/null -find /var/ -type f -name '*-old' -delete 2>/dev/null +find /etc/ -type f -name '*-' -or -name '.placeholder' | xargs rm -rf 2>/dev/null +find /var/ -type f -name '*-old' | xargs rm -rf 2>/dev/null find /var/log -type f | xargs -I {} bash -c '>{}' 2>/dev/null rm -rf \ ~/.cache ~/.composer* ~/.git* ~/.gnupg ~/.log ~/.npm* \ diff --git a/src/php/cli/Dockerfile b/src/php/cli/Dockerfile index c14d4d02..f2e65607 100644 --- a/src/php/cli/Dockerfile +++ b/src/php/cli/Dockerfile @@ -52,7 +52,6 @@ RUN echo "Installing PHP ${PHP_VERSION}" \ && php -r "copy('${COMPOSER_INSTALLER}', '${COMPOSER_SCRIPT}');" \ && php $COMPOSER_SCRIPT --install-dir=/usr/bin --filename=composer \ && chmod +xr /usr/bin/composer \ - && /usr/bin/composer global config --no-plugins allow-plugins.composer/installers true \ \ # cleanup && apt-upgrade -uq \ diff --git a/src/php/cli/php7.3.txt b/src/php/cli/php7.3.txt index abd92453..111fdacd 100644 --- a/src/php/cli/php7.3.txt +++ b/src/php/cli/php7.3.txt @@ -11,6 +11,9 @@ json mbstring memcached mysql +mysqli +opcache +pdo redis soap sqlite3 diff --git a/src/php/cli/php7.4.txt b/src/php/cli/php7.4.txt index abd92453..111fdacd 100644 --- a/src/php/cli/php7.4.txt +++ b/src/php/cli/php7.4.txt @@ -11,6 +11,9 @@ json mbstring memcached mysql +mysqli +opcache +pdo redis soap sqlite3 diff --git a/src/php/cli/php8.0.txt b/src/php/cli/php8.0.txt index 3ea5d227..789a9829 100644 --- a/src/php/cli/php8.0.txt +++ b/src/php/cli/php8.0.txt @@ -10,6 +10,9 @@ intl mbstring memcached mysql +mysqli +opcache +pdo redis soap sqlite3 diff --git a/src/php/cli/php8.1.txt b/src/php/cli/php8.1.txt index 3ea5d227..789a9829 100644 --- a/src/php/cli/php8.1.txt +++ b/src/php/cli/php8.1.txt @@ -10,6 +10,9 @@ intl mbstring memcached mysql +mysqli +opcache +pdo redis soap sqlite3 diff --git a/src/php/cli/php8.2.txt b/src/php/cli/php8.2.txt index 3ea5d227..e13bbd5b 100644 --- a/src/php/cli/php8.2.txt +++ b/src/php/cli/php8.2.txt @@ -1,20 +1,17 @@ -apcu bcmath cli common curl gd gmp -igbinary intl mbstring -memcached mysql -redis +mysqli +opcache +pdo soap sqlite3 tidy -uuid xml -yaml zip \ No newline at end of file diff --git a/src/php/cli/php9.0.txt b/src/php/cli/php9.0.txt index 3ea5d227..789a9829 100644 --- a/src/php/cli/php9.0.txt +++ b/src/php/cli/php9.0.txt @@ -10,6 +10,9 @@ intl mbstring memcached mysql +mysqli +opcache +pdo redis soap sqlite3 diff --git a/src/php/cli/root/etc/cont-init.d/200-composer-home b/src/php/cli/root/etc/cont-init.d/200-composer-home index 2161a2aa..ee1e921c 100755 --- a/src/php/cli/root/etc/cont-init.d/200-composer-home +++ b/src/php/cli/root/etc/cont-init.d/200-composer-home @@ -5,5 +5,4 @@ if [ "$DIR" != "/composer" ]; then [ -f "${DIR}/keys.dev.pub" ] || wdo php -r "copy('https://composer.github.io/snapshots.pub','${DIR}/keys.dev.pub');" [ -f "${DIR}/keys.tags.pub" ] || wdo php -r "copy('https://composer.github.io/releases.pub','${DIR}/keys.tags.pub');" chmod 0644 $DIR/*.pub 2>/dev/null - composer global config --no-plugins allow-plugins.composer/installers true fi \ No newline at end of file diff --git a/src/php/fpm/Dockerfile b/src/php/fpm/Dockerfile index 8ddf7066..3b0102dc 100644 --- a/src/php/fpm/Dockerfile +++ b/src/php/fpm/Dockerfile @@ -30,6 +30,9 @@ RUN apt-update \ && apt-upgrade -uq \ && cleanup +# adds config files +ADD root/ / + # opcache preload RUN if [ "$(php -r 'echo PHP_VERSION_ID;')" -ge "70400" ]; then \ echo '' >>/etc/php/fpm/pool.d/x-override-php-defaults.conf; \ @@ -37,8 +40,12 @@ RUN if [ "$(php -r 'echo PHP_VERSION_ID;')" -ge "70400" ]; then \ echo 'php_value[opcache.preload_user] = ${PHP_OPCACHE_PRELOAD_USER}' >>/etc/php/fpm/pool.d/x-override-php-defaults.conf; \ fi -# adds config files -ADD root/ / +# opcache jit +RUN if [ "$(php -r 'echo PHP_VERSION_ID;')" -ge "80000" ]; then \ + echo '' >>/etc/php/fpm/pool.d/x-override-php-defaults.conf; \ + echo 'php_value[opcache.jit] = ${PHP_OPCACHE_JIT}' >>/etc/php/fpm/pool.d/x-override-php-defaults.conf; \ + echo 'php_value[opcache.jit_buffer_size] = ${PHP_OPCACHE_BUFFER_SIZE}' >>/etc/php/fpm/pool.d/x-override-php-defaults.conf; \ +fi # sets the working directory # WORKDIR $WEBHOME @@ -83,5 +90,7 @@ ENV PHP_OPCACHE_REVALIDATE_FREQ=5 ENV PHP_OPCACHE_REVALIDATE_PATH=0 ENV PHP_OPCACHE_SAVE_COMMENTS=1 ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS=1 +ENV PHP_OPCACHE_JIT=tracing +ENV PHP_OPCACHE_BUFFER_SIZE=128M ################################################################################ \ No newline at end of file diff --git a/src/webapps/fuelphp/root/startup/500-init-fuelphp b/src/webapps/fuelphp/root/startup/500-init-fuelphp index 4cbbd4b7..9e91b074 100755 --- a/src/webapps/fuelphp/root/startup/500-init-fuelphp +++ b/src/webapps/fuelphp/root/startup/500-init-fuelphp @@ -6,6 +6,8 @@ FUEL_CHECK="$FUEL_ROOT/fuel/app" if [ ! -d "$FUEL_CHECK" ]; then echo; echo "🤖 Installing $FUEL_PROJECT from scratch" rm -rf $FUEL_ROOT/public $FUEL_ROOT/index.* - composer-create -d $FUEL_ROOT/ $FUEL_PROJECT $FUEL_ROOT/ + composer-create -d $FUEL_ROOT/ $FUEL_PROJECT $FUEL_ROOT/ --no-install + composer config -d $FUEL_ROOT/ --no-plugins allow-plugins.composer/installers true + composer-install -d $FUEL_ROOT/ wmd $FUEL_ROOT -R & fi \ No newline at end of file diff --git a/src/webapps/kirby/root/startup/500-init-kirby b/src/webapps/kirby/root/startup/500-init-kirby index 671270a3..b8516262 100755 --- a/src/webapps/kirby/root/startup/500-init-kirby +++ b/src/webapps/kirby/root/startup/500-init-kirby @@ -6,7 +6,8 @@ KIRBY_CHECK="$KIRBY_ROOT/kirby" if [ ! -d "$KIRBY_CHECK" ]; then echo; echo "🤖 Installing $KIRBY_PROJECT from scratch" rm -rf $KIRBY_ROOT/web $KIRBY_ROOT/index.* - composer global config --no-plugins allow-plugins.getkirby/composer-installer true - composer-create -d $KIRBY_ROOT/ $KIRBY_PROJECT $KIRBY_ROOT/ + composer-create -d $KIRBY_ROOT/ $KIRBY_PROJECT $KIRBY_ROOT/ --no-install + composer config -d $KIRBY_ROOT/ --no-plugins allow-plugins.getkirby/composer-installer true + composer-install -d $KIRBY_ROOT/ wmd $KIRBY_ROOT -R & fi \ No newline at end of file diff --git a/src/webapps/slim/root/startup/500-init-slim b/src/webapps/slim/root/startup/500-init-slim index b579a52f..a3fdd93a 100755 --- a/src/webapps/slim/root/startup/500-init-slim +++ b/src/webapps/slim/root/startup/500-init-slim @@ -6,6 +6,8 @@ SLIM_CHECK="$SLIM_ROOT/src/Application" if [ ! -d "$SLIM_CHECK" ]; then echo; echo "🤖 Installing $SLIM_PROJECT from scratch" rm -rf $SLIM_ROOT/public $SLIM_ROOT/index.* - composer-create -d $SLIM_ROOT/ $SLIM_PROJECT $SLIM_ROOT/ + composer-create -d $SLIM_ROOT/ $SLIM_PROJECT $SLIM_ROOT/ --no-install + composer config -d $SLIM_ROOT/ --no-plugins allow-plugins.phpstan/extension-installer true + composer-install -d $SLIM_ROOT/ wmd $SLIM_ROOT -R & fi \ No newline at end of file diff --git a/src/webapps/wordpress/Dockerfile b/src/webapps/wordpress/Dockerfile index f16e26c2..7d0b611b 100644 --- a/src/webapps/wordpress/Dockerfile +++ b/src/webapps/wordpress/Dockerfile @@ -36,7 +36,28 @@ ENV PHP_MAX_EXECUTION_TIME=300 ENV PHP_POST_MAX_SIZE=100M ENV PHP_UPLOAD_MAX_FILE_SIZE=10M -# set more env variables +# debug mode +ENV WORDPRESS_WP_DEBUG="0" + +# default locale ENV WORDPRESS_LOCALE="en_US" +# DB connection +ENV WORDPRESS_DB_HOST="localhost" +ENV WORDPRESS_DB_USER="username_here" +ENV WORDPRESS_DB_PASSWORD="password_here" +ENV WORDPRESS_DB_NAME="database_name_here" +ENV WORDPRESS_DB_CHARSET="utf8mb4" +ENV WORDPRESS_DB_COLLATE="" + +# security keys +ENV WORDPRESS_AUTH_KEY="" +ENV WORDPRESS_SECURE_AUTH_KEY="" +ENV WORDPRESS_LOGGED_IN_KEY="" +ENV WORDPRESS_NONCE_KEY="" +ENV WORDPRESS_AUTH_SALT="" +ENV WORDPRESS_SECURE_AUTH_SALT="" +ENV WORDPRESS_LOGGED_IN_SALT="" +ENV WORDPRESS_NONCE_SALT="" + ################################################################################ \ No newline at end of file diff --git a/src/webapps/wordpress/README.md b/src/webapps/wordpress/README.md index e3b928de..5133a552 100644 --- a/src/webapps/wordpress/README.md +++ b/src/webapps/wordpress/README.md @@ -161,6 +161,27 @@ ENV WEBHOME="/var/www/html" # the locale for a fresh Wordpress ENV WORDPRESS_LOCALE="en_US" +# debug mode +ENV WORDPRESS_WP_DEBUG="0" + +# DB connection +ENV WORDPRESS_DB_HOST="localhost" +ENV WORDPRESS_DB_USER="username_here" +ENV WORDPRESS_DB_PASSWORD="password_here" +ENV WORDPRESS_DB_NAME="database_name_here" +ENV WORDPRESS_DB_CHARSET="utf8mb4" +ENV WORDPRESS_DB_COLLATE="" + +# security keys +ENV WORDPRESS_AUTH_KEY="" +ENV WORDPRESS_SECURE_AUTH_KEY="" +ENV WORDPRESS_LOGGED_IN_KEY="" +ENV WORDPRESS_NONCE_KEY="" +ENV WORDPRESS_AUTH_SALT="" +ENV WORDPRESS_SECURE_AUTH_SALT="" +ENV WORDPRESS_LOGGED_IN_SALT="" +ENV WORDPRESS_NONCE_SALT="" + # ========================================================== # recommended settings @@ -200,6 +221,11 @@ services: TZ: UTC PUID: ${UID:-9999} PGID: ${GID:-9999} + WORDPRESS_WP_DEBUG: true + WORDPRESS_DB_HOST: mysql:3306 + WORDPRESS_DB_USER: root + WORDPRESS_DB_PASSWORD: mydb_p@ssw0rd + WORDPRESS_DB_NAME: my_database ports: - "80:80" - "443:443" diff --git a/src/webapps/wordpress/root/etc/docker-wordpress.php b/src/webapps/wordpress/root/etc/docker-wordpress.php new file mode 100644 index 00000000..0d3ef104 --- /dev/null +++ b/src/webapps/wordpress/root/etc/docker-wordpress.php @@ -0,0 +1,23 @@ +