khulnasoft commited on
Commit
8088974
·
verified ·
1 Parent(s): 94cde90

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -0
Dockerfile CHANGED
@@ -1,9 +1,18 @@
1
  # Use the official Node.js image as the base image
2
  FROM node:14
3
 
 
 
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
 
 
 
 
 
 
7
  # Copy package.json and package-lock.json to the working directory
8
  COPY package*.json ./
9
 
 
1
  # Use the official Node.js image as the base image
2
  FROM node:14
3
 
4
+ # Create a non-root user and group
5
+ RUN groupadd -r appgroup && useradd -r -g appgroup -m appuser
6
+
7
  # Set the working directory inside the container
8
  WORKDIR /app
9
 
10
+ # Change ownership of the working directory to the non-root user
11
+ RUN chown -R appuser:appgroup /app
12
+
13
+ # Switch to the non-root user
14
+ USER appuser
15
+
16
  # Copy package.json and package-lock.json to the working directory
17
  COPY package*.json ./
18