VISHAL18for4 commited on
Commit
62d5e99
·
verified ·
1 Parent(s): d23b076

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -11
Dockerfile CHANGED
@@ -1,23 +1,17 @@
1
- # Use the official Node.js 20 LTS image
2
  FROM node:20-alpine
3
 
4
- # Set working directory inside container
5
  WORKDIR /app
6
 
7
- # Copy package.json and package-lock.json (if exists)
8
  COPY package*.json ./
9
-
10
- # Install dependencies
11
  RUN npm install --production
12
 
13
- # Copy the rest of the application
14
  COPY . .
15
 
16
- # Create the snapshots directory at build time (optional, server will also create it)
17
- RUN mkdir -p /app/snapshots
18
 
19
- # Expose the port Hugging Face expects (default 7860)
20
- EXPOSE 7860
21
 
22
- # Start the server
23
  CMD ["node", "server.js"]
 
 
1
  FROM node:20-alpine
2
 
 
3
  WORKDIR /app
4
 
 
5
  COPY package*.json ./
 
 
6
  RUN npm install --production
7
 
 
8
  COPY . .
9
 
10
+ # Create snapshots dir and set ownership
11
+ RUN mkdir -p /app/snapshots && chown -R node:node /app
12
 
13
+ # Switch to non-root user
14
+ USER node
15
 
16
+ EXPOSE 7860
17
  CMD ["node", "server.js"]