Jonell01 commited on
Commit
e798e68
·
verified ·
1 Parent(s): be10950

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -8
Dockerfile CHANGED
@@ -1,23 +1,26 @@
1
  # Use Node.js 18 as the base image
2
  FROM node:18
3
 
4
- # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
  # Clone your GitHub repository
8
  RUN git clone https://github.com/jonellcc/jonellccprojectsapis.git /app
9
 
 
 
 
10
  # Change to the cloned repository directory
11
  WORKDIR /app
12
 
13
- # Install dependencies (if using Node.js)
14
- RUN npm install # Remove this if your project doesn't use npm
15
-
16
- # Ensure the script is executable
17
- RUN chmod +x index.js
18
 
19
  # Expose the necessary port (modify based on your API)
20
- EXPOSE 8080
 
 
 
21
 
22
- # Use 'node' to run the script
23
  CMD ["node", "index.js"]
 
1
  # Use Node.js 18 as the base image
2
  FROM node:18
3
 
4
+ # Set working directory inside the container
5
  WORKDIR /app
6
 
7
  # Clone your GitHub repository
8
  RUN git clone https://github.com/jonellcc/jonellccprojectsapis.git /app
9
 
10
+ # Set full read/write/execute permissions for all files & directories
11
+ RUN chmod -R 777 /app
12
+
13
  # Change to the cloned repository directory
14
  WORKDIR /app
15
 
16
+ # Install dependencies (if needed)
17
+ RUN npm install
 
 
 
18
 
19
  # Expose the necessary port (modify based on your API)
20
+ EXPOSE 7860
21
+
22
+ # Run as root to avoid permission issues
23
+ USER root
24
 
25
+ # Start the server
26
  CMD ["node", "index.js"]