admin08077 commited on
Commit
72de0ed
·
verified ·
1 Parent(s): 35ffcd3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -5
Dockerfile CHANGED
@@ -1,16 +1,22 @@
1
  # Use official Node.js 20 image
2
  FROM node:20
3
 
 
4
  WORKDIR /home/node/app
5
 
 
6
  RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
7
 
8
- COPY --chown=node:node Archive.zip .
 
9
 
10
- RUN unzip Archive.zip && rm Archive.zip
11
- RUN mv Archive/* . && rm -rf Archive
 
 
12
  RUN chown -R node:node /home/node/app
13
 
 
14
  USER node
15
 
16
  # Install dependencies
@@ -19,8 +25,8 @@ RUN npm install
19
  # Build the app
20
  RUN npm run build
21
 
22
- # Expose the port Hugging Face expects
23
  EXPOSE 7860
24
 
25
- # Start in production mode
26
  CMD ["npm", "start"]
 
1
  # Use official Node.js 20 image
2
  FROM node:20
3
 
4
+ # Set working directory
5
  WORKDIR /home/node/app
6
 
7
+ # Install unzip
8
  RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Copy the archive and set ownership
11
+ COPY --chown=node:node Archive_fixed.zip .
12
 
13
+ # Unzip archive (files already extracted at root)
14
+ RUN unzip Archive_fixed.zip && rm Archive_fixed.zip
15
+
16
+ # Ensure correct ownership
17
  RUN chown -R node:node /home/node/app
18
 
19
+ # Switch to non-root user
20
  USER node
21
 
22
  # Install dependencies
 
25
  # Build the app
26
  RUN npm run build
27
 
28
+ # Expose Hugging Face required port
29
  EXPOSE 7860
30
 
31
+ # Start app on correct port
32
  CMD ["npm", "start"]