StarrySkyWorld commited on
Commit
cb44554
·
verified ·
1 Parent(s): 8ca121c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -1
Dockerfile CHANGED
@@ -1 +1,33 @@
1
- FROM eceasy/cli-proxy-api:latest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1.7
2
+
3
+ FROM golang:1.24-alpine AS builder
4
+ RUN apk add --no-cache git ca-certificates
5
+
6
+ WORKDIR /src
7
+
8
+ ARG REPO_URL=https://github.com/Starry-Sky-World/CLIProxyAPI.git
9
+ ARG REPO_REF=main
10
+ RUN git clone --depth 1 --branch "${REPO_REF}" "${REPO_URL}" .
11
+
12
+ RUN go mod download
13
+
14
+ ARG VERSION=dev
15
+ ARG COMMIT=none
16
+ ARG BUILD_DATE=unknown
17
+ RUN CGO_ENABLED=0 GOOS=linux go build \
18
+ -ldflags="-s -w -X 'main.Version=${VERSION}' -X 'main.Commit=${COMMIT}' -X 'main.BuildDate=${BUILD_DATE}'" \
19
+ -o /out/CLIProxyAPI ./cmd/server/
20
+
21
+ FROM alpine:3.22.0
22
+ RUN apk add --no-cache tzdata ca-certificates
23
+
24
+ WORKDIR /CLIProxyAPI
25
+
26
+ COPY --from=builder /out/CLIProxyAPI ./CLIProxyAPI
27
+ COPY --from=builder /src/config.example.yaml ./config.example.yaml
28
+
29
+ EXPOSE 8317
30
+ ENV TZ=Asia/Shanghai
31
+ RUN cp /usr/share/zoneinfo/${TZ} /etc/localtime && echo "${TZ}" > /etc/timezone
32
+
33
+ CMD ["./CLIProxyAPI"]