From 5420eb8257fb56714f11b4f99117c84ac9900250 Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Sun, 11 Feb 2024 15:21:51 -0500 Subject: [PATCH 01/12] Add support for OroCommerce --- nginx/etc/nginx/available.d/oro-commerce.conf | 39 +++++++++++++++++++ php-fpm/orocommerce/Dockerfile | 30 ++++++++++++++ .../orocommerce/context/etc/php.d/75-oro.ini | 15 +++++++ .../supervisord.d/oro-message-consumer.ini | 9 +++++ .../etc/supervisord.d/oro-web-socket.ini | 8 ++++ php-fpm/orocommerce/context/oro-init | 7 ++++ php-fpm/orocommerce/debug/Dockerfile | 8 ++++ .../orocommerce/debug/context/50-xdebug.ini | 4 ++ php-fpm/orocommerce/xdebug3/Dockerfile | 8 ++++ .../orocommerce/xdebug3/context/50-xdebug.ini | 4 ++ postgres/Dockerfile | 1 - .../add-uuid-ossp-extension.sql | 1 + 12 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 nginx/etc/nginx/available.d/oro-commerce.conf create mode 100644 php-fpm/orocommerce/Dockerfile create mode 100644 php-fpm/orocommerce/context/etc/php.d/75-oro.ini create mode 100644 php-fpm/orocommerce/context/etc/supervisord.d/oro-message-consumer.ini create mode 100644 php-fpm/orocommerce/context/etc/supervisord.d/oro-web-socket.ini create mode 100755 php-fpm/orocommerce/context/oro-init create mode 100644 php-fpm/orocommerce/debug/Dockerfile create mode 100644 php-fpm/orocommerce/debug/context/50-xdebug.ini create mode 100644 php-fpm/orocommerce/xdebug3/Dockerfile create mode 100644 php-fpm/orocommerce/xdebug3/context/50-xdebug.ini create mode 100644 postgres/docker-entrypoint-initdb.d/add-uuid-ossp-extension.sql diff --git a/nginx/etc/nginx/available.d/oro-commerce.conf b/nginx/etc/nginx/available.d/oro-commerce.conf new file mode 100644 index 0000000..f2eb16a --- /dev/null +++ b/nginx/etc/nginx/available.d/oro-commerce.conf @@ -0,0 +1,39 @@ +gzip on; +gzip_proxied any; +gzip_types + text/plain + text/css + text/js + text/xml + text/javascript + application/javascript + application/x-javascript + application/json + application/xml + application/xml+rss + image/svg+xml; +gzip_vary on; + +location / { + # try to serve file directly, fallback to index.php + try_files $uri /index.php$is_args$args; +} + +location ~ ^/(index|index_dev|config|install)\.php(/|$) { + fastcgi_pass $fastcgi_backend; + + fastcgi_split_path_info ^(.+\.php)(/.*)$; + + include fastcgi_params; + + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param HTTPS on; + fastcgi_buffers 64 64k; + fastcgi_buffer_size 128k; +} + +location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ { + access_log off; + expires 1h; + add_header Cache-Control public; +} diff --git a/php-fpm/orocommerce/Dockerfile b/php-fpm/orocommerce/Dockerfile new file mode 100644 index 0000000..94e70f1 --- /dev/null +++ b/php-fpm/orocommerce/Dockerfile @@ -0,0 +1,30 @@ +ARG ENV_SOURCE_IMAGE +ARG PHP_VERSION + +FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} +ARG PHP_EXTENSIONS="pcntl pgsql pdo_pgsql imap tidy ldap pecl-mongodb" + +USER root + +RUN set -eux \ + && PHP_PACKAGES= && for PKG in ${PHP_EXTENSIONS}; do \ + if [[ ${PKG} = "mcrypt" ]] && (( ${PHP_VERSION} > 71 )); then continue; fi; \ + if [[ ${PKG} = "sodium" ]] && (( ${PHP_VERSION} < 72 )); then continue; fi; \ + PHP_PACKAGES+="php-${PKG} "; \ + done \ + && dnf install -y ${PHP_PACKAGES} jpegoptim pngquant supervisor \ + && dnf clean all \ + && rm -rf /var/cache/dnf \ + && perl -pi -e 's/^(memory_limit)=.*$/$1=2G/g' /etc/php-fpm-fcgi.ini + +RUN mkdir -p /var/log/supervisor \ + && chown www-data:www-data /var/log/supervisor + +COPY oro-init /usr/local/bin/ +COPY etc/php.d/*.ini /etc/php.d/ +COPY etc/supervisord.d/* /etc/supervisord.d/ + +# Inject the oro customization before starting PHP-FPM +RUN sed -i '/^exec "\$@"/i oro-init\n' /usr/local/bin/docker-entrypoint + +USER www-data \ No newline at end of file diff --git a/php-fpm/orocommerce/context/etc/php.d/75-oro.ini b/php-fpm/orocommerce/context/etc/php.d/75-oro.ini new file mode 100644 index 0000000..32dcf03 --- /dev/null +++ b/php-fpm/orocommerce/context/etc/php.d/75-oro.ini @@ -0,0 +1,15 @@ +[PHP] +max_execution_time=600 +realpath_cache_size=4096K +realpath_cache_ttl=600 + +[opcache] +opcache.enabled=1 +opcache.enable_cli=1 +opcache.memory_consumption=512 +opcache.interned_strings_buffer=32 +opcache.max_accelerated_files=32531 +opcache.save_comments=1 + +[zend] +zend.detect_unicode=0 \ No newline at end of file diff --git a/php-fpm/orocommerce/context/etc/supervisord.d/oro-message-consumer.ini b/php-fpm/orocommerce/context/etc/supervisord.d/oro-message-consumer.ini new file mode 100644 index 0000000..3480e1d --- /dev/null +++ b/php-fpm/orocommerce/context/etc/supervisord.d/oro-message-consumer.ini @@ -0,0 +1,9 @@ +[program:oro_message_consumer] +command=php ./bin/console oro:message-queue:consume --env=prod +process_name=%(program_name)s_%(process_num)02d +numprocs=5 +autostart=true +autorestart=true +directory=/var/www/html +user=www-data +redirect_stderr=false \ No newline at end of file diff --git a/php-fpm/orocommerce/context/etc/supervisord.d/oro-web-socket.ini b/php-fpm/orocommerce/context/etc/supervisord.d/oro-web-socket.ini new file mode 100644 index 0000000..30dd9ef --- /dev/null +++ b/php-fpm/orocommerce/context/etc/supervisord.d/oro-web-socket.ini @@ -0,0 +1,8 @@ +[program:oro_web_socket] +command=php ./bin/console gos:websocket:server --env=prod +numprocs=1 +autostart=true +autorestart=true +directory=/var/www/html +user=www-data +redirect_stderr=false \ No newline at end of file diff --git a/php-fpm/orocommerce/context/oro-init b/php-fpm/orocommerce/context/oro-init new file mode 100755 index 0000000..e3696d8 --- /dev/null +++ b/php-fpm/orocommerce/context/oro-init @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# Start supervisord +if [[ ${SUPERVISORD_START:-1} -eq 1 && -e /var/www/html/vendor/oro/platform/src/Oro/Component/MessageQueue/Client/ConsumeMessagesCommand.php ]]; then + sudo /usr/bin/supervisord -c /etc/supervisord.conf & +fi diff --git a/php-fpm/orocommerce/debug/Dockerfile b/php-fpm/orocommerce/debug/Dockerfile new file mode 100644 index 0000000..733fec1 --- /dev/null +++ b/php-fpm/orocommerce/debug/Dockerfile @@ -0,0 +1,8 @@ +ARG ENV_SOURCE_IMAGE +ARG PHP_VERSION +FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION}-orocommerce +USER root + +COPY *.ini /etc/php.d/ + +USER www-data \ No newline at end of file diff --git a/php-fpm/orocommerce/debug/context/50-xdebug.ini b/php-fpm/orocommerce/debug/context/50-xdebug.ini new file mode 100644 index 0000000..b2574e0 --- /dev/null +++ b/php-fpm/orocommerce/debug/context/50-xdebug.ini @@ -0,0 +1,4 @@ +[xdebug] +xdebug.scream=0 +xdebug.show_exception_trace=0 +xdebug.max_nesting_level=256 \ No newline at end of file diff --git a/php-fpm/orocommerce/xdebug3/Dockerfile b/php-fpm/orocommerce/xdebug3/Dockerfile new file mode 100644 index 0000000..733fec1 --- /dev/null +++ b/php-fpm/orocommerce/xdebug3/Dockerfile @@ -0,0 +1,8 @@ +ARG ENV_SOURCE_IMAGE +ARG PHP_VERSION +FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION}-orocommerce +USER root + +COPY *.ini /etc/php.d/ + +USER www-data \ No newline at end of file diff --git a/php-fpm/orocommerce/xdebug3/context/50-xdebug.ini b/php-fpm/orocommerce/xdebug3/context/50-xdebug.ini new file mode 100644 index 0000000..b2574e0 --- /dev/null +++ b/php-fpm/orocommerce/xdebug3/context/50-xdebug.ini @@ -0,0 +1,4 @@ +[xdebug] +xdebug.scream=0 +xdebug.show_exception_trace=0 +xdebug.max_nesting_level=256 \ No newline at end of file diff --git a/postgres/Dockerfile b/postgres/Dockerfile index 3820720..196aa22 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -2,4 +2,3 @@ ARG POSTGRES_VERSION FROM postgres:${POSTGRES_VERSION} COPY docker-entrypoint-initdb.d/uuid-ossp-extension.sql /docker-entrypoint-init.d/uuid-ossp-extension.sql - diff --git a/postgres/docker-entrypoint-initdb.d/add-uuid-ossp-extension.sql b/postgres/docker-entrypoint-initdb.d/add-uuid-ossp-extension.sql new file mode 100644 index 0000000..c941cb3 --- /dev/null +++ b/postgres/docker-entrypoint-initdb.d/add-uuid-ossp-extension.sql @@ -0,0 +1 @@ +CREATE EXTENSION "uuid-ossp"; From b964bc553c257a35290d9a5a8c132a8ad4c36c7a Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Wed, 14 Feb 2024 21:24:30 -0500 Subject: [PATCH 02/12] Adjust build script for orocommerce --- .github/workflows/php.yml | 43 +++++++++++++++++++ .../{oro-commerce.conf => orocommerce.conf} | 0 scripts/build.sh | 4 +- 3 files changed, 45 insertions(+), 2 deletions(-) rename nginx/etc/nginx/available.d/{oro-commerce.conf => orocommerce.conf} (100%) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 4d7c86f..3b856e8 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -184,3 +184,46 @@ jobs: PHP_VARIANT: ${{ matrix.php_variant }} INDEV_FLAG: ${{ github.ref == 'refs/heads/main' && '0' || '1' }} run: bash scripts/build.sh "${BUILD_GROUP}" + + orocommerce: + name: Build Warden PHP-FPM Images ${{ matrix.php_version }} (orocommerce) + runs-on: ubuntu-latest + needs: php-fpm + strategy: + matrix: + php_version: ["7.4", "8.0", "8.1", "8.2", "8.3"] + php_variant: ["fpm-loaders"] + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + - uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build & Push Images + env: + BUILD_GROUP: php-fpm/orocommerce + PRE_AUTH: 1 + WARDEN_IMAGE_REPOSITORY: ghcr.io/wardenenv + PHP_SOURCE_IMAGE: ghcr.io/wardenenv/centos-php + PUSH_FLAG: 1 + PHP_VERSION: ${{ matrix.php_version }} + PHP_VARIANT: ${{ matrix.php_variant }} + INDEV_FLAG: ${{ github.ref == 'refs/heads/main' && '0' || '1' }} + run: bash scripts/build.sh "${BUILD_GROUP}" + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build & Push Images (Docker Hub) + env: + BUILD_GROUP: php-fpm/orocommerce + PRE_AUTH: 1 + PHP_SOURCE_IMAGE: ghcr.io/wardenenv/centos-php + PUSH_FLAG: 1 + PHP_VERSION: ${{ matrix.php_version }} + PHP_VARIANT: ${{ matrix.php_variant }} + INDEV_FLAG: ${{ github.ref == 'refs/heads/main' && '0' || '1' }} + run: bash scripts/build.sh "${BUILD_GROUP}" \ No newline at end of file diff --git a/nginx/etc/nginx/available.d/oro-commerce.conf b/nginx/etc/nginx/available.d/orocommerce.conf similarity index 100% rename from nginx/etc/nginx/available.d/oro-commerce.conf rename to nginx/etc/nginx/available.d/orocommerce.conf diff --git a/scripts/build.sh b/scripts/build.sh index dae0be6..1bf034b 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -79,8 +79,8 @@ for file in $(find ${SEARCH_PATH} -type f -name Dockerfile | sort -V); do IMAGE_SUFFIX="$(echo "${BUILD_DIR}" | cut -d/ -f2- -s | tr / - | sed 's/^-//')" echo $IMAGE_SUFFIX - ## due to build matrix requirements, magento1 and magento2 specific varients are built in separate invocation - if [[ ${SEARCH_PATH} == "php-fpm" ]] && [[ ${file} =~ php-fpm/magento[1-2] ]]; then + ## due to build matrix requirements, magento and orocommerce specific varients are built in separate invocation + if [[ ${SEARCH_PATH} == "php-fpm" ]] && [[ ${file} =~ php-fpm/magento[1-2] || ${file} == "orocommerce" ]]; then continue; fi From 23cec57a47927d1e1f7caf1efc1d9c7d10582e9a Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Sat, 24 Feb 2024 12:54:12 -0500 Subject: [PATCH 03/12] Remove redundant packages --- php-fpm/orocommerce/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php-fpm/orocommerce/Dockerfile b/php-fpm/orocommerce/Dockerfile index 94e70f1..b7089e1 100644 --- a/php-fpm/orocommerce/Dockerfile +++ b/php-fpm/orocommerce/Dockerfile @@ -2,7 +2,7 @@ ARG ENV_SOURCE_IMAGE ARG PHP_VERSION FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION} -ARG PHP_EXTENSIONS="pcntl pgsql pdo_pgsql imap tidy ldap pecl-mongodb" +ARG PHP_EXTENSIONS="pcntl imap tidy ldap pecl-mongodb" USER root @@ -27,4 +27,4 @@ COPY etc/supervisord.d/* /etc/supervisord.d/ # Inject the oro customization before starting PHP-FPM RUN sed -i '/^exec "\$@"/i oro-init\n' /usr/local/bin/docker-entrypoint -USER www-data \ No newline at end of file +USER www-data From 2255933254f06ffcf377ba98461a5eebb9245b2a Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Tue, 11 Jun 2024 14:55:52 -0400 Subject: [PATCH 04/12] Adjust PHP build versions --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 3b856e8..d985281 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -191,7 +191,7 @@ jobs: needs: php-fpm strategy: matrix: - php_version: ["7.4", "8.0", "8.1", "8.2", "8.3"] + php_version: ["8.2", "8.3"] php_variant: ["fpm-loaders"] steps: - uses: actions/checkout@v3 From 97767bdfa1b21ac927706c252b6992bf0ae9fb4c Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Fri, 14 Jun 2024 23:17:20 -0400 Subject: [PATCH 05/12] Fix build scripts for OroCommerce --- .github/workflows/php.yml | 2 +- php-fpm/orocommerce/blackfire/Dockerfile | 20 ++++++++++++++++++++ scripts/build.sh | 7 ++++++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 php-fpm/orocommerce/blackfire/Dockerfile diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d985281..a9772cc 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -186,7 +186,7 @@ jobs: run: bash scripts/build.sh "${BUILD_GROUP}" orocommerce: - name: Build Warden PHP-FPM Images ${{ matrix.php_version }} (orocommerce) + name: Build Warden PHP-FPM Images ${{ matrix.php_version }} (OroCommerce) runs-on: ubuntu-latest needs: php-fpm strategy: diff --git a/php-fpm/orocommerce/blackfire/Dockerfile b/php-fpm/orocommerce/blackfire/Dockerfile new file mode 100644 index 0000000..a962634 --- /dev/null +++ b/php-fpm/orocommerce/blackfire/Dockerfile @@ -0,0 +1,20 @@ +ARG ENV_SOURCE_IMAGE +ARG PHP_VERSION +FROM ${ENV_SOURCE_IMAGE}:${PHP_VERSION}-orocommerce +USER root + +RUN curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" \ + | sudo tee /etc/yum.repos.d/blackfire.repo \ + && dnf install -y blackfire-php \ + && dnf clean all \ + && rm -rf /var/cache/dnf + +# Install the Blackfire Client to provide access to the CLI tool +RUN mkdir -p /tmp/blackfire \ + && curl -L https://blackfire.io/api/v1/releases/client/linux_static/amd64 | tar zxp -C /tmp/blackfire \ + && mv /tmp/blackfire/blackfire /usr/bin/blackfire \ + && rm -rf /tmp/blackfire + +COPY blackfire/etc/php.d/*.ini /etc/php.d/ + +USER www-data diff --git a/scripts/build.sh b/scripts/build.sh index 1bf034b..48265ba 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -124,8 +124,13 @@ for file in $(find ${SEARCH_PATH} -type f -name Dockerfile | sort -V); do continue fi - if [[ -d "$(echo ${BUILD_DIR} | cut -d/ -f1)/context" ]]; then + # Allow child builds to have their own context directory (e.g. php-fpm/magento2/context) + if [[ -d "${BUILD_DIR}/context" ]]; then + BUILD_CONTEXT="${BUILD_DIR}/context" + # Check if parent directory has a specific context directory + elif [[ -d "$(echo ${BUILD_DIR} | cut -d/ -f1)/context" ]]; then BUILD_CONTEXT="$(echo ${BUILD_DIR} | cut -d/ -f1)/context" + # Use the entire build directory as the context else BUILD_CONTEXT="${BUILD_DIR}" fi From 9847b95bc491cd548e89a757ab861c575b5a1e38 Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Fri, 14 Jun 2024 23:25:18 -0400 Subject: [PATCH 06/12] Temporarily remove dependency to test build --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a9772cc..095eb86 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -188,7 +188,7 @@ jobs: orocommerce: name: Build Warden PHP-FPM Images ${{ matrix.php_version }} (OroCommerce) runs-on: ubuntu-latest - needs: php-fpm + # needs: php-fpm strategy: matrix: php_version: ["8.2", "8.3"] From 8c2487a3c2f62f29212ca130181f46387131766e Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Fri, 14 Jun 2024 23:28:53 -0400 Subject: [PATCH 07/12] Use non-dev base images temporarily --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 095eb86..5ce5785 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -211,7 +211,7 @@ jobs: PUSH_FLAG: 1 PHP_VERSION: ${{ matrix.php_version }} PHP_VARIANT: ${{ matrix.php_variant }} - INDEV_FLAG: ${{ github.ref == 'refs/heads/main' && '0' || '1' }} + INDEV_FLAG: 0 # ${{ github.ref == 'refs/heads/main' && '0' || '1' }} run: bash scripts/build.sh "${BUILD_GROUP}" - uses: docker/login-action@v2 with: From eccd9f39a5704dcc62c3fbae13f9db6ce924544d Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Mon, 17 Jun 2024 14:06:08 -0400 Subject: [PATCH 08/12] Fix postgres init not being used --- postgres/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres/Dockerfile b/postgres/Dockerfile index 196aa22..13581f3 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -1,4 +1,4 @@ ARG POSTGRES_VERSION FROM postgres:${POSTGRES_VERSION} -COPY docker-entrypoint-initdb.d/uuid-ossp-extension.sql /docker-entrypoint-init.d/uuid-ossp-extension.sql +COPY docker-entrypoint-initdb.d/uuid-ossp-extension.sql /docker-entrypoint-initdb.d/uuid-ossp-extension.sql From 7e9f20166f7d1cdffbb143d2be8cfbf66b4feb1f Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Mon, 17 Jun 2024 14:08:20 -0400 Subject: [PATCH 09/12] Updating supervisord configs for Oro services --- .../context/etc/supervisord.d/oro-message-consumer.ini | 2 +- .../orocommerce/context/etc/supervisord.d/oro-web-socket.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/php-fpm/orocommerce/context/etc/supervisord.d/oro-message-consumer.ini b/php-fpm/orocommerce/context/etc/supervisord.d/oro-message-consumer.ini index 3480e1d..817e127 100644 --- a/php-fpm/orocommerce/context/etc/supervisord.d/oro-message-consumer.ini +++ b/php-fpm/orocommerce/context/etc/supervisord.d/oro-message-consumer.ini @@ -6,4 +6,4 @@ autostart=true autorestart=true directory=/var/www/html user=www-data -redirect_stderr=false \ No newline at end of file +redirect_stderr=true \ No newline at end of file diff --git a/php-fpm/orocommerce/context/etc/supervisord.d/oro-web-socket.ini b/php-fpm/orocommerce/context/etc/supervisord.d/oro-web-socket.ini index 30dd9ef..a3c450a 100644 --- a/php-fpm/orocommerce/context/etc/supervisord.d/oro-web-socket.ini +++ b/php-fpm/orocommerce/context/etc/supervisord.d/oro-web-socket.ini @@ -5,4 +5,4 @@ autostart=true autorestart=true directory=/var/www/html user=www-data -redirect_stderr=false \ No newline at end of file +redirect_stderr=true \ No newline at end of file From 910b6b6bdf840dbc123c0eba6f44fdeb335cbd04 Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Mon, 17 Jun 2024 14:24:57 -0400 Subject: [PATCH 10/12] Adjust postgres build versions --- .github/workflows/postgres.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/postgres.yml b/.github/workflows/postgres.yml index ac4c8a7..f32add0 100644 --- a/.github/workflows/postgres.yml +++ b/.github/workflows/postgres.yml @@ -17,11 +17,23 @@ jobs: fail-fast: false matrix: version: - - "16" + - "12.19" + - "13.15" + - "14.12" - "15" - - "14" - - "13" - - "12" + - "15.0" + - "15.1" + - "15.2" + - "15.3" + - "15.4" + - "15.5" + - "15.6" + - "15.7" + - "16" + - "16.0" + - "16.1" + - "16.2" + - "16.3" steps: - uses: actions/checkout@v3 From 53e22b3341485fb4fcea69914035c954783788a8 Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Mon, 17 Jun 2024 15:54:03 -0400 Subject: [PATCH 11/12] Adjust OroCommerce nginx config --- nginx/etc/nginx/available.d/orocommerce.conf | 40 +++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/nginx/etc/nginx/available.d/orocommerce.conf b/nginx/etc/nginx/available.d/orocommerce.conf index f2eb16a..671bd9a 100644 --- a/nginx/etc/nginx/available.d/orocommerce.conf +++ b/nginx/etc/nginx/available.d/orocommerce.conf @@ -1,21 +1,4 @@ -gzip on; -gzip_proxied any; -gzip_types - text/plain - text/css - text/js - text/xml - text/javascript - application/javascript - application/x-javascript - application/json - application/xml - application/xml+rss - image/svg+xml; -gzip_vary on; - location / { - # try to serve file directly, fallback to index.php try_files $uri /index.php$is_args$args; } @@ -30,6 +13,8 @@ location ~ ^/(index|index_dev|config|install)\.php(/|$) { fastcgi_param HTTPS on; fastcgi_buffers 64 64k; fastcgi_buffer_size 128k; + + internal; } location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ { @@ -37,3 +22,24 @@ location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ { expires 1h; add_header Cache-Control public; } + +gzip on; +gzip_proxied any; +gzip_types + text/plain + text/css + text/js + text/xml + text/javascript + application/javascript + application/x-javascript + application/json + application/xml + application/xml+rss + image/svg+xml; +gzip_vary on; + +# Deny access to other "sensitive" locations / scripts +location ~* (\.php$|\.htaccess$|\.git) { + deny all; +} \ No newline at end of file From 49a9bd8ec2cfe227b3720b6a8f781a8f32bf69bc Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Fri, 26 Jul 2024 15:18:22 -0400 Subject: [PATCH 12/12] Updating PHP extension configurations --- php-fpm/orocommerce/Dockerfile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/php-fpm/orocommerce/Dockerfile b/php-fpm/orocommerce/Dockerfile index b7089e1..70bad3c 100644 --- a/php-fpm/orocommerce/Dockerfile +++ b/php-fpm/orocommerce/Dockerfile @@ -15,7 +15,15 @@ RUN set -eux \ && dnf install -y ${PHP_PACKAGES} jpegoptim pngquant supervisor \ && dnf clean all \ && rm -rf /var/cache/dnf \ - && perl -pi -e 's/^(memory_limit)=.*$/$1=2G/g' /etc/php-fpm-fcgi.ini + && perl -pi -e 's/^(memory_limit)=.*$/$1=1G/g' /etc/php-fpm-fcgi.ini \ + && perl -pi -e 's/^(realpath_cache_size)=.*$/$1=4096K/g' /etc/php-fpm-fcgi.ini \ + && perl -pi -e 's/^(realpath_cache_ttl)=.*$/$1=600/g' /etc/php-fpm-fcgi.ini \ + && perl -pi -e 's/^(opcache\.enable)=.*$/$1=1/g' /etc/php.d/10-opcache.ini \ + && perl -pi -e 's/^(opcache\.enable_cli)=.*$/$1=0/g' /etc/php.d/10-opcache.ini \ + && perl -pi -e 's/^(opcache\.memory_consumption)=.*$/$1=512/g' /etc/php.d/10-opcache.ini \ + && perl -pi -e 's/^(opcache\.interned_strings_buffer)=.*$/$1=32/g' /etc/php.d/10-opcache.ini \ + && perl -pi -e 's/^(opcache\.max_accelerated_files)=.*$/$1=32531/g' /etc/php.d/10-opcache.ini \ + && perl -pi -e 's/^(opcache\.save_comments)=.*$/$1=1/g' /etc/php.d/10-opcache.ini RUN mkdir -p /var/log/supervisor \ && chown www-data:www-data /var/log/supervisor @@ -24,6 +32,9 @@ COPY oro-init /usr/local/bin/ COPY etc/php.d/*.ini /etc/php.d/ COPY etc/supervisord.d/* /etc/supervisord.d/ +# Disabling Phar extension +RUN sed 's/^\(extension=phar\)/;\1/' /etc/php.d/*-phar.ini + # Inject the oro customization before starting PHP-FPM RUN sed -i '/^exec "\$@"/i oro-init\n' /usr/local/bin/docker-entrypoint