mikmc5 commited on
Commit
46fb3b5
·
verified ·
1 Parent(s): c789ad7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -9
Dockerfile CHANGED
@@ -1,19 +1,23 @@
1
- FROM node:20-slim
 
2
 
3
- WORKDIR /code
 
4
 
5
- # Copy package files
6
  COPY package*.json ./
7
 
8
- # Install dependencies (adding dotenv)
9
- RUN npm install
10
 
11
- # Bundle app source
12
  COPY . .
13
 
14
- # Default environment variables if not provided at runtime
15
- ENV PORT=7000
16
  ENV NODE_ENV=production
17
 
18
- # Start the application
 
 
 
19
  CMD ["node", "index.js"]
 
1
+ # Use the official Node.js 18 base imag
2
+ FROM node:18-slim
3
 
4
+ # Set the working directory inside the container
5
+ WORKDIR /usr/src/app
6
 
7
+ # Copy the package.json and package-lock.json if available
8
  COPY package*.json ./
9
 
10
+ # Install the app dependencies
11
+ RUN npm install --production
12
 
13
+ # Copy the rest of the application code to the container
14
  COPY . .
15
 
16
+ # Set environment variable to production
 
17
  ENV NODE_ENV=production
18
 
19
+ # Expose the port Hugging Face Spaces will bind to
20
+ EXPOSE 7000
21
+
22
+ # Command to start the app
23
  CMD ["node", "index.js"]