From 6eb398549c52bd092f082191bfbf2252707d0f75 Mon Sep 17 00:00:00 2001 From: hsyam Date: Tue, 27 Oct 2020 03:23:15 -0700 Subject: [PATCH 1/3] Add NewRelic support for php-FPM --- php-fpm/Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index d05426d3..18c2bb26 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -921,6 +921,25 @@ RUN if [ ${INSTALL_XMLRPC} = true ]; then \ docker-php-ext-install xmlrpc \ ;fi +########################################################################### +# New Relic for PHP: +########################################################################### + +ARG NEW_RELIC_KEY=000000 +ARG NEW_RELIC_APP_NAME=app_name +RUN \ + curl -L http://download.newrelic.com/php_agent/release/newrelic-php5-9.13.0.270-linux.tar.gz | 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* && \ + sed -i \ + -e 's/"REPLACE_WITH_REAL_KEY"/"${NEW_RELIC_KEY}"/' \ + -e 's/newrelic.appname = "PHP Application"/newrelic.appname = "${NEW_RELIC_APP_NAME}"/' \ + -e 's/;newrelic.daemon.app_connect_timeout =.*/newrelic.daemon.app_connect_timeout=15s/' \ + -e 's/;newrelic.daemon.start_timeout =.*/newrelic.daemon.start_timeout=5s/' \ + /usr/local/etc/php/conf.d/newrelic.ini + ########################################################################### # Downgrade Openssl: ########################################################################### From 5258e493731220b50a22f1cecedacad425f28bb3 Mon Sep 17 00:00:00 2001 From: hsyam Date: Thu, 17 Dec 2020 14:09:06 +0200 Subject: [PATCH 2/3] add new relic configurations to env && update new relice to stabile version --- env-example | 6 ++++++ php-fpm/Dockerfile | 13 +++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/env-example b/env-example index 0d4ebe6c..bdfd69fb 100644 --- a/env-example +++ b/env-example @@ -250,6 +250,12 @@ PHP_FPM_DEFAULT_LOCALE=POSIX PHP_FPM_PUID=1000 PHP_FPM_PGID=1000 +### PHP_FPM_NEW_RELIC ##################################### + +PHP_FPM_NEW_RELIC=false +PHP_FPM_NEW_RELIC_KEY=0000 +PHP_FPM_NEW_RELIC_APP_NAME=app_name + ### PHP_WORKER ############################################ PHP_WORKER_INSTALL_BZ2=false diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 18c2bb26..9e540057 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -924,11 +924,12 @@ RUN if [ ${INSTALL_XMLRPC} = true ]; then \ ########################################################################### # New Relic for PHP: ########################################################################### +ARG NEW_RELIC=${NEW_RELIC} +ARG NEW_RELIC_KEY=${NEW_RELIC_KEY} +ARG NEW_RELIC_APP_NAME=${NEW_RELIC_APP_NAME} -ARG NEW_RELIC_KEY=000000 -ARG NEW_RELIC_APP_NAME=app_name -RUN \ - curl -L http://download.newrelic.com/php_agent/release/newrelic-php5-9.13.0.270-linux.tar.gz | tar -C /tmp -zx && \ +RUN if [ ${NEW_RELIC} = true ]; then \ + curl -L http://download.newrelic.com/php_agent/archive/9.9.0.260/newrelic-php5-9.9.0.260-linux.tar.gz | tar -C /tmp -zx && \ export NR_INSTALL_USE_CP_NOT_LN=1 && \ export NR_INSTALL_SILENT=1 && \ /tmp/newrelic-php5-*/newrelic-install install && \ @@ -938,8 +939,8 @@ RUN \ -e 's/newrelic.appname = "PHP Application"/newrelic.appname = "${NEW_RELIC_APP_NAME}"/' \ -e 's/;newrelic.daemon.app_connect_timeout =.*/newrelic.daemon.app_connect_timeout=15s/' \ -e 's/;newrelic.daemon.start_timeout =.*/newrelic.daemon.start_timeout=5s/' \ - /usr/local/etc/php/conf.d/newrelic.ini - + /usr/local/etc/php/conf.d/newrelic.ini \ +;fi ########################################################################### # Downgrade Openssl: ########################################################################### From a1517c084a4ee6645e6a8e95d24e6e15b801b2fe Mon Sep 17 00:00:00 2001 From: hsyam Date: Thu, 17 Dec 2020 14:25:12 +0200 Subject: [PATCH 3/3] add new relic configurations to docker-compose.yml --- docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index cb056aca..0447dcfa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -252,6 +252,9 @@ services: - PUID=${PHP_FPM_PUID} - PGID=${PHP_FPM_PGID} - LOCALE=${PHP_FPM_DEFAULT_LOCALE} + - PHP_FPM_NEW_RELIC=${PHP_FPM_NEW_RELIC} + - PHP_FPM_NEW_RELIC_KEY=${PHP_FPM_NEW_RELIC_KEY} + - PHP_FPM_NEW_RELIC_APP_NAME=${PHP_FPM_NEW_RELIC_APP_NAME} - http_proxy - https_proxy - no_proxy