mikmc5 commited on
Commit
7fb3aaa
·
verified ·
1 Parent(s): 546469e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -12
Dockerfile CHANGED
@@ -1,19 +1,19 @@
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 express node-fetch cors dotenv
10
-
11
- # Bundle app source
12
- COPY . .
13
-
14
- # Default environment variables if not provided at runtime
15
  ENV PORT=7860
16
  ENV NODE_ENV=production
17
 
18
- # Start the application
19
- CMD ["node", "server.js"]
 
 
 
 
 
 
 
1
  FROM node:20-slim
2
 
3
+ WORKDIR /app
4
 
5
+ # Copy only the bundled application file
6
+ COPY app.js .
7
 
8
+ # Default environment variables
 
 
 
 
 
 
9
  ENV PORT=7860
10
  ENV NODE_ENV=production
11
 
12
+ # Make the application executable
13
+ RUN chmod +x app.js
14
+
15
+ # Expose the port that the application uses
16
+ EXPOSE 7860
17
+
18
+ # Start the application directly
19
+ CMD ["./app.js"]