From 11c4fa567de4156e4f06ae96930d3baab989c310 Mon Sep 17 00:00:00 2001 From: mariacha Date: Mon, 23 Dec 2024 13:30:59 -0800 Subject: [PATCH 1/4] Applying our diffs to the docker file until https://github.com/richarvey/nginx-php-fpm/pull/292 is merged. --- Dockerfile | 50 +++++++++++++++++++++++++++++++++++++++++++++++-- conf/nginx.conf | 5 +++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a75d1e0..0c8ea819 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.7-fpm-alpine3.18 +FROM php:8.3.0-fpm-alpine3.18 LABEL maintainer="Ric Harvey " @@ -76,7 +76,6 @@ RUN apk add --no-cache --virtual .sys-deps \ pecl install -o -f mongodb && \ echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini && \ echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini && \ - echo "zend_extension=xdebug" > /usr/local/etc/php/conf.d/xdebug.ini && \ docker-php-source delete && \ mkdir -p /var/www/app && \ # Install composer and certbot @@ -152,3 +151,50 @@ EXPOSE 443 80 WORKDIR "/var/www/html" CMD ["/start.sh"] + +# Bring in our nginx customizations +COPY conf/nginx-site.conf /etc/nginx/sites-available/default.conf +COPY conf/nginx.conf /etc/nginx/nginx.conf + +# TS Customizations +RUN apk add --no-cache mysql-client \ + su-exec \ + rsync +RUN export PATH="~/.composer/vendor/bin:$PATH" && \ + echo "sendmail_path=`which true`" >> ${php_vars} \ + && echo "memory_limit = 256M" >> ${php_vars} \ + # Get WP CLI + && 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 \ + # Get Drush launcher + && wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/download/0.5.1/drush.phar \ + && chmod +x drush.phar \ + && mv drush.phar /usr/local/bin/drush \ + # Get Terminus + && mkdir -p /var/www/.composer \ + && cd /var/www/.composer \ + && curl -O https://raw.githubusercontent.com/pantheon-systems/terminus-installer/master/builds/installer.phar \ + && php installer.phar install \ + # Get Drupal console + && curl https://drupalconsole.com/installer -L -o drupal.phar \ + && chmod +x drupal.phar \ + && mv drupal.phar /usr/local/bin/drupal +# Get java for Behat/selenium/chromedriver tests +RUN apk add --no-cache openjdk8-jre \ + patch + +# Add an extension for commerce. +RUN docker-php-ext-install bcmath + +# Get Google Chrome (well, chromium) +RUN apk add -U --no-cache --allow-untrusted chromium + +# Add packages and settings for screener.io automated visual regression testing +RUN apk add --update jq +RUN apk add -U --no-cache nghttp2-dev npm +RUN npm config set unsafe-perm=true +ENV NODE_PATH /usr/lib/node_modules +RUN npm install dotenv@latest --global +RUN npm install screener-runner@latest --global +# End TS Customizations diff --git a/conf/nginx.conf b/conf/nginx.conf index 19f1b456..b04f98fa 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -33,6 +33,11 @@ http { server_tokens off; #gzip on; + # TS Customizations start. + fastcgi_buffers 128 2048k; + fastcgi_buffer_size 2048k; + # TS Customizations end. + # Disabled due to license # geoip2 /etc/nginx/GeoLite2-Country.mmdb { # auto_reload 1h; From a926f113071afa8dc1635d1997d6a3fd93565424 Mon Sep 17 00:00:00 2001 From: mariacha Date: Mon, 23 Dec 2024 13:51:11 -0800 Subject: [PATCH 2/4] Changing how unsafe permissions are allowed. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0c8ea819..f0073e6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -193,7 +193,7 @@ RUN apk add -U --no-cache --allow-untrusted chromium # Add packages and settings for screener.io automated visual regression testing RUN apk add --update jq RUN apk add -U --no-cache nghttp2-dev npm -RUN npm config set unsafe-perm=true +ENV NPM_CONFIG_UNSAFE_PERM=true ENV NODE_PATH /usr/lib/node_modules RUN npm install dotenv@latest --global RUN npm install screener-runner@latest --global From ed5280714444d62e10539683fa466dd3bd1bf0f3 Mon Sep 17 00:00:00 2001 From: mariacha Date: Mon, 23 Dec 2024 14:40:22 -0800 Subject: [PATCH 3/4] Incorrect env declaration maybe. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f0073e6f..00e7820d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -193,7 +193,7 @@ RUN apk add -U --no-cache --allow-untrusted chromium # Add packages and settings for screener.io automated visual regression testing RUN apk add --update jq RUN apk add -U --no-cache nghttp2-dev npm -ENV NPM_CONFIG_UNSAFE_PERM=true +ENV NPM_CONFIG_UNSAFE_PERM true ENV NODE_PATH /usr/lib/node_modules RUN npm install dotenv@latest --global RUN npm install screener-runner@latest --global From d898aca4dfe2c7c53017ac5dd78a1279632e39d4 Mon Sep 17 00:00:00 2001 From: mariacha Date: Mon, 23 Dec 2024 14:52:39 -0800 Subject: [PATCH 4/4] moving scripts above the start.sh file, where they were previously. --- Dockerfile | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 00e7820d..b4ff0154 100644 --- a/Dockerfile +++ b/Dockerfile @@ -134,28 +134,6 @@ RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini && \ /usr/local/etc/php/php.ini -# Add Scripts -ADD scripts/start.sh /start.sh -ADD scripts/pull /usr/bin/pull -ADD scripts/push /usr/bin/push -ADD scripts/letsencrypt-setup /usr/bin/letsencrypt-setup -ADD scripts/letsencrypt-renew /usr/bin/letsencrypt-renew -RUN chmod 755 /usr/bin/pull && chmod 755 /usr/bin/push && chmod 755 /usr/bin/letsencrypt-setup && chmod 755 /usr/bin/letsencrypt-renew && chmod 755 /start.sh - -# copy in code -ADD src/ /var/www/html/ -ADD errors/ /var/www/errors - - -EXPOSE 443 80 - -WORKDIR "/var/www/html" -CMD ["/start.sh"] - -# Bring in our nginx customizations -COPY conf/nginx-site.conf /etc/nginx/sites-available/default.conf -COPY conf/nginx.conf /etc/nginx/nginx.conf - # TS Customizations RUN apk add --no-cache mysql-client \ su-exec \ @@ -198,3 +176,25 @@ ENV NODE_PATH /usr/lib/node_modules RUN npm install dotenv@latest --global RUN npm install screener-runner@latest --global # End TS Customizations + +# Add Scripts +ADD scripts/start.sh /start.sh +ADD scripts/pull /usr/bin/pull +ADD scripts/push /usr/bin/push +ADD scripts/letsencrypt-setup /usr/bin/letsencrypt-setup +ADD scripts/letsencrypt-renew /usr/bin/letsencrypt-renew +RUN chmod 755 /usr/bin/pull && chmod 755 /usr/bin/push && chmod 755 /usr/bin/letsencrypt-setup && chmod 755 /usr/bin/letsencrypt-renew && chmod 755 /start.sh + +# copy in code +ADD src/ /var/www/html/ +ADD errors/ /var/www/errors + + +EXPOSE 443 80 + +WORKDIR "/var/www/html" +CMD ["/start.sh"] + +# Bring in our nginx customizations +COPY conf/nginx-site.conf /etc/nginx/sites-available/default.conf +COPY conf/nginx.conf /etc/nginx/nginx.conf