File size: 608 Bytes
b267528
553c00b
 
 
b9e6e15
 
 
553c00b
fedb52d
553c00b
 
 
 
 
 
 
 
b9e6e15
 
 
553c00b
 
cbe30d3
 
 
b267528
553c00b
b267528
553c00b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM golang:1.23-alpine AS builder

WORKDIR /app

# 安装 git 和 ca-certificates,某些依赖可能需要
RUN apk add --no-cache git ca-certificates

COPY go.mod go.sum ./
RUN go mod download -x || (cat go.mod && cat go.sum && exit 1)

COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o zai-proxy .

FROM alpine:latest

WORKDIR /app

# 安装 ca-certificates 以支持 HTTPS
RUN apk add --no-cache ca-certificates

COPY --from=builder /app/zai-proxy .

# proxies.txt 可通过 docker run -v ./proxies.txt:/app/proxies.txt 挂载
VOLUME ["/app/proxies.txt"]

EXPOSE 7860

ENV PORT=7860
CMD ["./zai-proxy"]