mirror of
https://github.com/zhengkai/orca.git
synced 2026-02-04 13:32:27 +08:00
chore: docker
This commit is contained in:
@@ -4,7 +4,7 @@ FROM golang:latest as builder
|
||||
|
||||
ARG DOCKER_RUNNING=yes
|
||||
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
|
||||
|
||||
COPY . /project
|
||||
@@ -15,10 +15,10 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
|
||||
# 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 ./misc/docker/http-ca.crt /etc/ssl/certs/elastic-http-ca.crt
|
||||
|
||||
@@ -2,7 +2,6 @@ package metrics
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"project/zj"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
@@ -34,8 +33,7 @@ func Limit(h http.Header) {
|
||||
if h.Get(`x-ratelimit-limit-tokens`) != `` {
|
||||
token := h.Get(`x-ratelimit-remaining-tokens`)
|
||||
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