New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newrelic APM support #171
Comments
Hi @gaudinjeremy, Try this, this works for me:
|
Thanks @TrafeX, The installation has been completed, but I haven't received any data from Newrelic. I modified the code by adding this line to activate newrelic : "-e "s/;newrelic.enabled =.*/newrelic.enabled = true/" " but this had no effect. Here's my complete dockerfile `ARG ALPINE_VERSION=3.18 Setup document rootWORKDIR /var/www/html Install packages and remove default server definitionRUN apk add --no-cache Configure nginx - httpCOPY config/nginx.conf /etc/nginx/nginx.conf Configure nginx - default serverCOPY config/conf.d /etc/nginx/conf.d/ Configure PHP-FPMENV PHP_INI_DIR /etc/php82 Configure supervisordCOPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf Make sure files/folders needed by the processes are accessable when they run under the nobody userRUN chown -R nobody.nobody /var/www/html /run /var/lib/nginx /var/log/nginx Create symlink for phpRUN ln -s /usr/bin/php82 /usr/bin/php ARG NEW_RELIC_LICENSE_KEY="xxxxxxxxxx" Install New RelicRUN mkdir -p /var/log/newrelic /var/run/newrelic && Switch to use a non-root user from here onUSER nobody Add applicationCOPY --chown=nobody src/ /var/www/html/ Expose the port nginx is reachable onEXPOSE 8080 Let supervisord start nginx & php-fpmCMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] Configure a healthcheck to validate that everything is up&runningHEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping Thanks |
@gaudinjeremy this is the relevant code you need to add to your Dockerfile (discarding your previously implementation of APM). It is tested working on Of course you need to build the image with the right
|
Thanks for the reply, in the meantime I'd found a solution by putting the deamon in another container, which works perfectly. Best |
Hello,
I tried to add the newrelic APM for php but I get this error:
It seems to be a file path problem linked to this line "0.760 sed: /usr/local/etc/php82/conf.d/newrelic.ini: No such file or directory" but even by changing the directories I haven't managed to finalize the installation.
I followed the newrelic doc to install (https://docs.newrelic.com/docs/apm/agents/php-agent/advanced-installation/docker-other-container-environments-install-php-agent/#install-diff-containers)
Thanks
The text was updated successfully, but these errors were encountered: