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 facfc9b commit c1f1491
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ WORKDIR /usr/src/app
# Copy package.json and package-lock.json for dependency installation
COPY package*.json ./

# Install app dependencies
RUN npm install
# Install app dependencies using npm ci for a clean, reproducible environment
RUN npm ci --only=production

# Copy the rest of the application code
COPY . .

# Run build script (if applicable)
# RUN npm run build

# Remove any unnecessary files like development dependencies
# RUN npm prune --production

# Stage 2: Production Stage
FROM node:18.19.1

Expand All @@ -41,5 +47,9 @@ EXPOSE 3000
# Switch to the non-root user for running the application
USER nonroot

# Add a health check to ensure the container is running properly
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl --fail http://localhost:3000/ || exit 1

# Define the command to run your Node.js application
CMD ["node", "index.js"]

0 comments on commit c1f1491

Please sign in to comment.