devusman commited on
Commit
038c860
·
1 Parent(s): b205898

updated dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -13
Dockerfile CHANGED
@@ -1,27 +1,22 @@
1
- # Use an official Node.js runtime as a parent image.
2
- # Using the 'alpine' variant for a smaller image size.
3
  FROM node:18-alpine
4
 
5
  # Set the working directory inside the container
6
  WORKDIR /app
7
 
8
- # Copy package.json and package-lock.json to leverage Docker cache
9
  COPY package*.json ./
10
-
11
- # Install app dependencies
12
  RUN npm install
13
 
14
- # Copy the rest of your application's code into the container
15
- # This includes index.js, the 'views' directory, and the 'dist' directory
16
  COPY . .
17
 
18
- # Your Express app listens on port 3000
19
- EXPOSE 3000
20
 
21
- # Metadata for Hugging Face Spaces
22
- # This tells Spaces that the app is a web application running on port 3000
23
- LABEL "app_port"="3000"
24
  LABEL "app_file"="index.js"
25
 
26
- # The command to run your application
27
  CMD ["node", "index.js"]
 
1
+ # Use a stable and small Node.js image
 
2
  FROM node:18-alpine
3
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Copy package files and install dependencies first to leverage Docker's layer caching
8
  COPY package*.json ./
 
 
9
  RUN npm install
10
 
11
+ # Copy the rest of your application code
 
12
  COPY . .
13
 
14
+ # Expose the port that Hugging Face Spaces expects
15
+ EXPOSE 7860
16
 
17
+ # Metadata for Hugging Face Spaces to identify the running application port
18
+ LABEL "app_port"="7860"
 
19
  LABEL "app_file"="index.js"
20
 
21
+ # The command to start your Express server
22
  CMD ["node", "index.js"]