rahgadda commited on
Commit
2c12fbd
1 Parent(s): 4596d7c

Initial Draft

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -8
Dockerfile CHANGED
@@ -1,15 +1,12 @@
1
  # Node base image
2
  FROM node:16
3
 
4
- # Set up a new user named "user" with user ID 1000
5
- RUN useradd -m -u 1000 user
6
-
7
- # Switch to the "user" user
8
- USER user
9
 
10
  # Set home to the user's home directory
11
- ENV HOME=/home/user \
12
- PATH=/home/user/.local/bin:$PATH
13
 
14
  # Set the working directory to the user's home directory
15
  WORKDIR $HOME/app
@@ -18,7 +15,7 @@ WORKDIR $HOME/app
18
  ADD . $HOME/app
19
 
20
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
21
- COPY --chown=user . $HOME/app
22
 
23
  # Loading Dependencies
24
  RUN npm install
 
1
  # Node base image
2
  FROM node:16
3
 
4
+ # Switch to the "node" user
5
+ USER node
 
 
 
6
 
7
  # Set home to the user's home directory
8
+ ENV HOME=/home/node \
9
+ PATH=/home/node/.local/bin:$PATH
10
 
11
  # Set the working directory to the user's home directory
12
  WORKDIR $HOME/app
 
15
  ADD . $HOME/app
16
 
17
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
18
+ COPY --chown=node . $HOME/app
19
 
20
  # Loading Dependencies
21
  RUN npm install