fix: set version info for Docker image

This commit is contained in:
JustSong
2022-12-10 15:23:38 +08:00
parent 1aaa8b64b5
commit 62c5ef7f4f
2 changed files with 7 additions and 2 deletions
+3 -2
View File
@@ -2,8 +2,9 @@ FROM node:16 as builder
WORKDIR /build
COPY ./web .
COPY ./VERSION .
RUN npm install
RUN npm run build
RUN REACT_APP_VERSION=$(cat VERSION) npm run build
FROM golang AS builder2
@@ -15,7 +16,7 @@ WORKDIR /build
COPY . .
COPY --from=builder /build/build ./web/build
RUN go mod download
RUN go build -ldflags "-s -w -extldflags '-static'" -o message-pusher
RUN go build -ldflags "-s -w -X 'gin-template/common.Version=$(cat VERSION)' -extldflags '-static'" -o message-pusher
FROM alpine