Merge remote-tracking branch 'origin/upstream/main'

This commit is contained in:
Laisky.Cai
2024-01-11 09:28:40 +00:00
165 changed files with 14022 additions and 45 deletions

View File

@@ -1,9 +1,16 @@
FROM node:18 as builder
WORKDIR /build
COPY ./web .
WORKDIR /web
COPY ./VERSION .
RUN chmod u+x ./build.sh && ./build.sh
COPY ./web .
WORKDIR /web/default
RUN npm install
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
WORKDIR /web/berry
RUN npm install
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
FROM golang:1.21.5-bullseye AS builder2
@@ -15,7 +22,7 @@ WORKDIR /build
ADD go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=builder /build/build ./web/build
COPY --from=builder /web/build ./web/build
RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api
FROM debian:bullseye
@@ -33,4 +40,4 @@ RUN apt-get install -y --no-install-recommends ca-certificates haveged tzdata \
COPY --from=builder2 /build/one-api /
EXPOSE 3000
WORKDIR /data
ENTRYPOINT ["/one-api"]
ENTRYPOINT ["/one-api"]