See https://support.newrelic.com/s/hubtopic/aAX8W0000008aNCWAY/relic-solution-single-php-script-docker-containers for getting it up and running:
Start the daemon in external startup mode before we run any PHP script. If we are in agent startup mode we’d need a second dummy PHP script to start the daemon before step 2.
Call a dummy PHP script to force the app to connect to New Relic servers. This request won’t be reported to New Relic and is lost.
(OPTIONAL) Give some time after our script runs so that it can report to New Relic. The Agent only reports data captured once a minute so a 30second PHP script container won’t report data. If you have used the API to stop/start/stop transactions within your script then this may not be necessary as transactions will report once a minute even before your PHP script finishes.