Mythus commited on
Commit
3fb0a50
·
verified ·
1 Parent(s): 9606723

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -1,12 +1,15 @@
1
  FROM node:14-slim
2
 
 
 
 
3
  ENV HOME=/home/user \
4
  PATH=/home/user/.local/bin:$PATH
5
 
6
  WORKDIR $HOME/app
7
 
8
  # Copy application files
9
- COPY . /app
10
 
11
  # Install dependencies (if there are any Node.js dependencies, list them here)
12
  RUN npm install
@@ -15,4 +18,4 @@ RUN npm install
15
  EXPOSE 8080
16
 
17
  # Command to run the script
18
- CMD ["node", "run.js"]
 
1
  FROM node:14-slim
2
 
3
+ # Create a non-root user
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
  ENV HOME=/home/user \
7
  PATH=/home/user/.local/bin:$PATH
8
 
9
  WORKDIR $HOME/app
10
 
11
  # Copy application files
12
+ COPY --chown=user . .
13
 
14
  # Install dependencies (if there are any Node.js dependencies, list them here)
15
  RUN npm install
 
18
  EXPOSE 8080
19
 
20
  # Command to run the script
21
+ CMD ["node", "run.js"]