Skip to content

Commit

Permalink
Add New Relic PHP agent
Browse files Browse the repository at this point in the history
  • Loading branch information
amrav committed Feb 3, 2018
1 parent c72b6b0 commit d5c1ce2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ SERVER_NAME=http://localhost:8080
DROPBOX_ACCESS_TOKEN=
GOOGLE_MAPS_API_KEY=
SLACK_WEBHOOK_URL=
NEWRELIC_LICENSE=
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ services:
- SERVER_NAME=$SERVER_NAME
- GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY
- SLACK_WEBHOOK_URL=$SLACK_WEBHOOK_URL
- NEWRELIC_LICENSE=$NEWRELIC_LICENSE
mediawiki:
build: './mediawiki'
21 changes: 18 additions & 3 deletions php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM php:7-fpm
RUN apt-get -qq update && apt-get -qq install -y \
build-essential \
git-core \
gnupg2 \
graphicsmagick \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libpng-dev \
libicu-dev \
git-core \
graphicsmagick \
wget \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd intl mysqli \
&& pecl install apcu \
Expand All @@ -18,6 +20,19 @@ ENV TZ=Asia/Kolkata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY php.ini /usr/local/etc/php/

# New Relic
RUN echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | tee /etc/apt/sources.list.d/newrelic.list \
&& wget -O- https://download.newrelic.com/548C16BF.gpg | apt-key add - \
&& apt-get update \
&& apt-get -qq install -y newrelic-php5 \
&& NR_INSTALL_SILENT=1 newrelic-install install \
&& sed -i \
-e "s/newrelic.appname =.*/newrelic.appname = \"Metakgp Wiki\"/" \
-e "s/newrelic.license =.*/newrelic.license = \${NEWRELIC_LICENSE}/" \
-e "s/;newrelic.framework =.*/newrelic.framework = \"mediawiki\"/" \
/usr/local/etc/php/conf.d/newrelic.ini

RUN mkdir -p /var/log/mediawiki \
&& touch /var/log/mediawiki/debug.log \
&& chown -R www-data:www-data /var/log/mediawiki
Expand Down

0 comments on commit d5c1ce2

Please sign in to comment.