diff --git a/Dockerfile b/Dockerfile index e69710a..2a7ae03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,6 +67,21 @@ RUN chmod +x /usr/local/bin/composer RUN curl -sL https://files.magerun.net/n98-magerun2-2.1.2.phar -o /usr/local/bin/n98-magerun2 RUN chmod +x /usr/local/bin/n98-magerun2 +# Install NewRelic PHP agent +# Next ENV variables must be populated: NEW_RELIC_LICENSE_KEY, NEW_RELIC_APP_NAME +RUN \ + curl -L https://download.newrelic.com/php_agent/release/newrelic-php5-10.0.0.312-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_LICENSE_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 + # Install config files and tester site COPY ./config/nginx /etc/nginx COPY ./config/php /usr/local/etc/php