sfun commited on
Commit
d78da00
1 Parent(s): 2e7523d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -6
Dockerfile CHANGED
@@ -1,10 +1,24 @@
1
- FROM golang:1.21-alpine AS builder
 
2
 
 
3
  WORKDIR /app
4
 
5
- RUN apk add git && git clone https://github.com/xyy002/claudetoapi.git .
6
- RUN sed -i'' 's|r.POST("/v1|r.POST("/api/v1|g' /app/main.go
7
- RUN GOOS=linux GOARCH=amd64 go build -o getkeyinfo
8
- RUN chmod +x /app/claudetoapi
9
 
10
- CMD ["sh", "-c", "nohup ./claudetoapi >> run.log 2>&1 &"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 https://github.com/teralomaniac/clewd.git .
 
 
9
 
10
+ # Install the dependencies
11
+ RUN npm install --no-audit --fund false
12
+
13
+ # Change ownership of files in lib/bin and set permissions
14
+ RUN chown -R node:node lib/bin/* && \
15
+ chmod u+x lib/bin/* && \
16
+ chmod -R 777 /app
17
+
18
+ # Run as the "node" user for better security practices
19
+ USER node
20
+
21
+ RUN ls -la
22
+
23
+ # Start the application
24
+ CMD ["node", "clewd.js"]