admin08077 commited on
Commit
324728b
·
verified ·
1 Parent(s): 200f3d9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -10
Dockerfile CHANGED
@@ -8,23 +8,27 @@ ENV HOME=/home/node \
8
  # Set working directory inside node's home
9
  WORKDIR $HOME/app
10
 
11
- # Install unzip and any other utilities
12
  RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copy zip file with correct ownership directly to the app folder
15
  COPY --chown=node:node Archive.zip .
 
16
 
17
- # Unzip as root (so unzip works) then fix permissions in one step
18
- RUN unzip Archive.zip && rm Archive.zip && chown -R node:node $HOME/app
19
-
20
- # Switch to the non-root node user
21
  USER node
22
 
23
  # Install dependencies
24
  RUN npm install
25
 
26
- # Expose the app port
27
- EXPOSE 3000
 
 
 
 
 
 
28
 
29
- # Start the app
30
- CMD ["npm", "start"]
 
8
  # Set working directory inside node's home
9
  WORKDIR $HOME/app
10
 
11
+ # Install unzip and clean apt cache
12
  RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Copy project zip and extract it
15
  COPY --chown=node:node Archive.zip .
16
+ RUN unzip Archive.zip && rm Archive.zip
17
 
18
+ # Switch to node user
 
 
 
19
  USER node
20
 
21
  # Install dependencies
22
  RUN npm install
23
 
24
+ # Build the Vite app for production
25
+ RUN npm run build
26
+
27
+ # Install a lightweight HTTP server to serve dist/
28
+ RUN npm install -g serve
29
+
30
+ # Expose Hugging Face Spaces default port
31
+ EXPOSE 7860
32
 
33
+ # Serve the built files
34
+ CMD ["serve", "-s", "dist", "-l", "7860"]