Skip to content

Commit

Permalink
new relic added
Browse files Browse the repository at this point in the history
  • Loading branch information
Amits64 committed Sep 6, 2024
1 parent 4abb918 commit facfc9b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
# Stage 1: Build Stage
FROM node:18.19.1-bookworm-slim AS build
FROM node:18.19.1 AS build

# Set environment variables for New Relic
ENV NEW_RELIC_NO_CONFIG_FILE=true
ENV NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=true
ENV NEW_RELIC_LOG=stdout

# Create a directory for your app and set it as the working directory
WORKDIR /usr/src/app

# Copy specific files and directories required for the image to run
COPY package.json .
COPY package-lock.json .
# Copy package.json and package-lock.json for dependency installation
COPY package*.json ./

# Install app dependencies and update npm
RUN npm install -g [email protected]
# Install app dependencies
RUN npm install

# Copy the rest of the application code including views directory
# Copy the rest of the application code
COPY . .

# Stage 2: Production Stage
FROM node:18.19.1-bookworm-slim
FROM node:18.19.1

# Create a non-root user and group for running the application
RUN groupadd -g 1001 nonroot && useradd -u 1001 -g nonroot -m nonroot

# Create a directory for your app and set it as the working directory
WORKDIR /usr/src/app

# Set environment variables for New Relic
ENV NEW_RELIC_NO_CONFIG_FILE=true
ENV NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=true
ENV NEW_RELIC_LOG=stdout
Expand Down

0 comments on commit facfc9b

Please sign in to comment.