admin08077 commited on
Commit
0132345
·
verified ·
1 Parent(s): f5ef775

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -12
Dockerfile CHANGED
@@ -1,29 +1,26 @@
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 for extracting your archive
8
  RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
9
 
10
- # Copy the archive and set ownership to 'node' user
11
  COPY --chown=node:node Archive.zip .
12
 
13
- # Unzip the archive
14
  RUN unzip Archive.zip && rm Archive.zip
15
-
16
- # Move contents of Archive/ up one level, then remove the empty folder
17
  RUN mv Archive/* . && rm -rf Archive
18
-
19
- # Make sure the node user owns everything
20
  RUN chown -R node:node /home/node/app
21
 
22
- # Switch to the 'node' user for security and to avoid permission errors
23
  USER node
24
 
25
- # Install npm dependencies as 'node' user
26
  RUN npm install
27
 
28
- # Default command to start your app (adjust if your start script differs)
29
- CMD ["npm", "start"]
 
 
 
 
 
 
 
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
17
  RUN npm install
18
 
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"]