chore: docker

This commit is contained in:
Zheng Kai
2023-09-07 14:59:14 +08:00
parent 3c76c9f1b2
commit 0fc7868b71
2 changed files with 5 additions and 7 deletions
+4 -4
View File
@@ -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
+1 -3
View File
@@ -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`))
} }
} }