Selinore commited on
Commit
5ac0759
·
verified ·
1 Parent(s): 070d2bd

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 git clone https://github.com/teralomaniac/clewd.git .
10
+ RUN sed -i 's|/v1/chat|/api/v1/chat|g' /app/clewd.js && \
11
+ sed -i 's|/v1/models|/api/v1/models|g' /app/clewd.js
12
+ RUN sed -i -E '/res\.write\(`<!DOCTYPE html>.*<\/html>`\);/d' /app/clewd.js
13
+
14
+ # Install the dependencies
15
+ RUN npm install --no-audit --fund false
16
+
17
+ # Change ownership of files in lib/bin and set permissions
18
+ RUN chown -R node:node lib/bin/* && \
19
+ chmod u+x lib/bin/* && \
20
+ chmod -R 777 /app
21
+
22
+ # Run as the "node" user for better security practices
23
+ USER node
24
+
25
+ RUN ls -la
26
+
27
+ ENV PORT=7860
28
+ EXPOSE 7860
29
+
30
+ # Start the application
31
+ CMD ["node", "clewd.js"]