Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- 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
|
| 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
|
| 14 |
-
RUN npm install
|
| 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
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
#
|
| 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"]
|