🔨 Update build script

This commit is contained in:
LittleSheep 2024-11-12 20:48:48 +08:00
parent c0fec10846
commit f7d82bc93a
3 changed files with 10 additions and 8 deletions

View File

@ -25,4 +25,4 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: xsheep2010/dealer:nightly
tags: xsheep2010/nexus:nightly

View File

@ -1,7 +1,5 @@
# Building Backend
FROM golang:alpine as dealer-server
RUN apk add nodejs npm
FROM golang:alpine as nexus-server
WORKDIR /source
COPY . .
@ -12,8 +10,8 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs -o /dist ./pkg/main
# Runtime
FROM golang:alpine
COPY --from=dealer-server /dist /dealer/server
COPY --from=nexus-server /dist /nexus/server
EXPOSE 8444
CMD ["/dealer/server"]
CMD ["/nexus/server"]

View File

@ -6,6 +6,7 @@ import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/proxy"
"github.com/spf13/viper"
"github.com/valyala/fasthttp"
"strings"
)
@ -34,6 +35,9 @@ func forwardService(c *fiber.Ctx) error {
c.Request().Header.Del(fiber.HeaderAuthorization)
}
return proxy.Do(c, url)
return proxy.Do(c, url, &fasthttp.Client{
NoDefaultUserAgentHeader: true,
DisablePathNormalizing: true,
StreamResponseBody: true,
})
}