admin08077 commited on
Commit
7b58e87
·
verified ·
1 Parent(s): 5622372

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -2,19 +2,25 @@ FROM node:18
2
 
3
  WORKDIR /app
4
 
5
- # Install unzip
6
  RUN apt-get update && apt-get install -y unzip
7
 
8
  # Copy your zip file
9
  COPY Archive.zip /app/
10
 
11
- # Unzip and remove the archive
12
  RUN unzip Archive.zip && rm Archive.zip
13
 
14
- # Install dependencies
 
 
 
 
 
 
15
  RUN npm install
16
 
17
- # Expose the port your app uses (change if needed)
18
  EXPOSE 3000
19
 
20
  # Start the app
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install unzip and any needed utilities
6
  RUN apt-get update && apt-get install -y unzip
7
 
8
  # Copy your zip file
9
  COPY Archive.zip /app/
10
 
11
+ # Unzip and remove archive
12
  RUN unzip Archive.zip && rm Archive.zip
13
 
14
+ # Make sure the app directory is owned by node user (safer than root)
15
+ RUN chown -R node:node /app
16
+
17
+ # Switch to non-root user for better security and permission handling
18
+ USER node
19
+
20
+ # Install dependencies as node user
21
  RUN npm install
22
 
23
+ # Expose port (adjust if needed)
24
  EXPOSE 3000
25
 
26
  # Start the app