Add Node.js New Relic agent with an on/off switch via NEW_RELIC_ENABLED in .env. Uses a preload script (-r newrelic-preload.js) so the agent loads before all other modules. Configured entirely through environment variables — no newrelic.js config file needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18 lines
304 B
Docker
18 lines
304 B
Docker
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
|
|
# New Relic agent — configured entirely via environment variables
|
|
ENV NEW_RELIC_NO_CONFIG_FILE=true
|
|
ENV NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=true
|
|
ENV NEW_RELIC_LOG=stdout
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["npm", "run", "start:dev"]
|