25 lines
1.3 KiB
Docker
25 lines
1.3 KiB
Docker
FROM oven/bun:1.4.0 AS webbuild
|
|
WORKDIR /build/web
|
|
COPY web/package.json web/bun.lock ./
|
|
RUN bun install --frozen-lockfile
|
|
COPY web ./
|
|
COPY VERSION /build/VERSION
|
|
RUN bun run typecheck
|
|
RUN bun run test src/features/pricing/__tests__/group-pricing.test.ts src/features/pricing/__tests__/dynamic-price.test.ts
|
|
RUN bunx oxlint -c .oxlintrc.json src/features/pricing/types.ts src/features/pricing/lib/dynamic-price.ts src/features/pricing/components/model-card.tsx src/features/pricing/components/model-details.tsx src/features/pricing/__tests__/group-pricing.test.ts
|
|
RUN VITE_REACT_APP_VERSION=$(cat /build/VERSION) bun run build
|
|
|
|
FROM local/new-api:group-cache-status-tests-20260905 AS build
|
|
ENV CGO_ENABLED=0 GOWORK=off GOEXPERIMENT=greenteagc
|
|
WORKDIR /build
|
|
COPY go.mod go.sum ./
|
|
COPY relaykit/go.mod ./relaykit/go.mod
|
|
RUN go mod download
|
|
COPY . .
|
|
COPY --from=webbuild /build/web/dist ./web/dist
|
|
RUN go test ./relay/helper ./setting/billing_setting ./controller ./service -run 'TestGroupModelPricing|TestModelPriceHelperTiered|TestAppendStreamStatusTreatsClientGoneAsDisplayNormal|TestClientFacing|TestPublicUpstreamErrorContent'
|
|
RUN go build -ldflags "-s -w -X github.com/QuantumNous/new-api/common.Version=$(cat VERSION)" -o /new-api
|
|
|
|
FROM local/new-api:v1.0.0-rc.30-group-cache-status-20260906-r4
|
|
COPY --from=build /new-api /new-api
|