admin08077 commited on
Commit
7269e5b
·
verified ·
1 Parent(s): b71bacf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -13
Dockerfile CHANGED
@@ -1,32 +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
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.zip .
12
-
13
- # Unzip archive (files already extracted at root)
14
- RUN unzip Archive.zip && rm Archive.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
 
 
 
 
23
  RUN npm install
 
24
 
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"]
 
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
+ RUN unzip Archive.zip -d . && rm Archive.zip
 
 
 
 
10
  RUN chown -R node:node /home/node/app
11
 
 
12
  USER node
13
 
14
+ # Add Hugging Face API Key as environment variable
15
+ # (will be overridden at runtime)
16
+ ENV HUGGINGFACE_API_KEY=""
17
+
18
+ COPY --chown=node:node package*.json ./
19
  RUN npm install
20
+ COPY --chown=node:node . .
21
 
 
22
  RUN npm run build
23
 
 
24
  EXPOSE 7860
25
 
 
26
  CMD ["npm", "start"]