clone3 commited on
Commit
3e238cf
·
verified ·
1 Parent(s): 9274dec

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -0
Dockerfile CHANGED
@@ -8,9 +8,18 @@ ENV PASSWORD=mypassword
8
  # Set the working directory inside the container
9
  WORKDIR /app
10
 
 
 
 
11
  # Clone the repository
12
  RUN git clone https://github.com/ChrisCindy/node-web-console.git .
13
 
 
 
 
 
 
 
14
  # Install dependencies
15
  RUN npm install
16
 
 
8
  # Set the working directory inside the container
9
  WORKDIR /app
10
 
11
+ # Create a non-root user to run the application
12
+ RUN useradd --create-home --shell /bin/bash appuser
13
+
14
  # Clone the repository
15
  RUN git clone https://github.com/ChrisCindy/node-web-console.git .
16
 
17
+ # Change ownership of the directory to the non-root user
18
+ RUN chown -R appuser:appuser /app
19
+
20
+ # Switch to the non-root user
21
+ USER appuser
22
+
23
  # Install dependencies
24
  RUN npm install
25