g2api / Dockerfile
bingloo's picture
Upload Dockerfile
253eae5 verified
raw
history blame contribute delete
581 Bytes
FROM golang:latest AS builder
WORKDIR /app
RUN git clone https://github.com/bingloo/genspark2api.git . && \
sed -i 's|v1Router := router.Group("/v1")|v1Router := router.Group("/api/v1")|' router/api-router.go && \
go mod download && \
CGO_ENABLED=0 go build -o /app/bin/g2api -ldflags="-w -s" .
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/bin/g2api .
RUN apk add --no-cache tzdata && \
chmod +x g2api
ENV TZ=Asia/Shanghai \
PORT=7050 \
REQUEST_RATE_LIMIT=1000 \
AUTO_DEL_CHAT=0
ENTRYPOINT ["./g2api"]