feat: 构建版本

This commit is contained in:
tbphp
2025-07-13 04:16:17 +08:00
parent 45944869b6
commit 586f135d80
3 changed files with 9 additions and 2 deletions

View File

@@ -1,13 +1,15 @@
FROM node:20-alpine AS builder
ARG VERSION=1.0.0
WORKDIR /build
COPY ./web .
RUN npm install
RUN npm run build
RUN VITE_VERSION=${VERSION} npm run build
FROM golang:alpine AS builder2
ARG VERSION=1.0.0
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux
@@ -19,7 +21,7 @@ RUN go mod download
COPY . .
COPY --from=builder /build/dist ./web/dist
RUN go build -ldflags "-s -w " -o gpt-load
RUN go build -ldflags "-s -w -X gpt-load/internal/version.Version=${VERSION}" -o gpt-load
FROM alpine