Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official Node.js image as the base image
|
2 |
+
FROM node:20.4
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Git clone clewd
|
8 |
+
RUN git clone -b think https://github.com/jianglinzhang/clewd.git .
|
9 |
+
RUN sed -i -E '/res\.write\(`<!DOCTYPE html>.*<\/html>`\);/d' /app/clewd.js
|
10 |
+
|
11 |
+
# Install the dependencies
|
12 |
+
RUN npm install --no-audit --fund false
|
13 |
+
|
14 |
+
# Change ownership of files in lib/bin and set permissions
|
15 |
+
RUN chown -R node:node lib/bin/* && \
|
16 |
+
chmod u+x lib/bin/* && \
|
17 |
+
chmod -R 777 /app
|
18 |
+
|
19 |
+
# Run as the "node" user for better security practices
|
20 |
+
USER node
|
21 |
+
|
22 |
+
RUN ls -la
|
23 |
+
|
24 |
+
ENV PORT=7860
|
25 |
+
EXPOSE 7860
|
26 |
+
|
27 |
+
# Start the application
|
28 |
+
CMD ["node", "clewd.js"]
|