bingloo commited on
Commit
71c9f31
·
verified ·
1 Parent(s): 12e769c

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM golang:latest AS builder
2
+
3
+ WORKDIR /app
4
+
5
+ RUN git clone https://github.com/deanxv/genspark2api.git . && \
6
+ sed -i 's|v1Router := router.Group("/v1")|v1Router := router.Group("/api/v1")|' router/api-router.go && \
7
+ CGO_ENABLED=0 go build -o /app/bin/g2api -ldflags="-w -s" .
8
+
9
+
10
+ FROM alpine:latest
11
+
12
+ WORKDIR /app
13
+
14
+ COPY --from=builder /app/bin/g2api .
15
+
16
+ RUN chmod +x g2api
17
+
18
+ ENV PORT=7050 \
19
+ TZ=Asia/Shanghai
20
+
21
+ ENTRYPOINT ["./g2api"]