mirror of
https://github.com/zhengkai/orca.git
synced 2026-03-01 00:35:36 +08:00
chore: docker
This commit is contained in:
@@ -4,7 +4,7 @@ FROM golang:latest as builder
|
|||||||
|
|
||||||
ARG DOCKER_RUNNING=yes
|
ARG DOCKER_RUNNING=yes
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt update && apt install -yq protobuf-compiler tzdata ca-certificates
|
RUN apt update && apt install -yq protobuf-compiler
|
||||||
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0
|
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0
|
||||||
|
|
||||||
COPY . /project
|
COPY . /project
|
||||||
@@ -15,10 +15,10 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
|||||||
|
|
||||||
# clean stage
|
# clean stage
|
||||||
|
|
||||||
FROM alpine
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk add --no-cache tzdata ca-certificates
|
||||||
|
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
||||||
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/
|
|
||||||
COPY --from=builder /project/server/dist/prod/orca-server-next /orca-server
|
COPY --from=builder /project/server/dist/prod/orca-server-next /orca-server
|
||||||
|
|
||||||
COPY ./misc/docker/http-ca.crt /etc/ssl/certs/elastic-http-ca.crt
|
COPY ./misc/docker/http-ca.crt /etc/ssl/certs/elastic-http-ca.crt
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package metrics
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"project/zj"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -34,8 +33,7 @@ func Limit(h http.Header) {
|
|||||||
if h.Get(`x-ratelimit-limit-tokens`) != `` {
|
if h.Get(`x-ratelimit-limit-tokens`) != `` {
|
||||||
token := h.Get(`x-ratelimit-remaining-tokens`)
|
token := h.Get(`x-ratelimit-remaining-tokens`)
|
||||||
limitToken.WithLabelValues(model).Set(strToFloat(token))
|
limitToken.WithLabelValues(model).Set(strToFloat(token))
|
||||||
|
// zj.J(`limit time`, model, h.Get(`x-ratelimit-reset-requests`), h.Get(`x-ratelimit-reset-tokens`))
|
||||||
zj.J(`limit time`, model, h.Get(`x-ratelimit-reset-requests`), h.Get(`x-ratelimit-reset-tokens`))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user