Changeset 0.7.0.13 (#38)

This commit is contained in:
2026-02-21 13:53:36 +00:00
parent a95e246cd7
commit b72bfbb5b4
10 changed files with 42 additions and 20 deletions

View File

@@ -16,8 +16,9 @@ FROM golang:1.22-bookworm AS backend
WORKDIR /app
COPY server/go.mod server/go.sum* ./
COPY server/ .
COPY VERSION ./
RUN go mod download && go mod tidy && go mod verify
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /bin/switchboard .
RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=$(cat VERSION)" -o /bin/switchboard .
# ── Stage 2: Vendor JS libs ─────────────────
FROM node:20-alpine AS vendor
@@ -43,6 +44,11 @@ COPY --from=backend /bin/switchboard /usr/local/bin/switchboard
# Frontend static files
COPY src/ /usr/share/nginx/html/
COPY VERSION /VERSION
# Inject version into index.html at build time
RUN APP_VERSION=$(cat /VERSION | tr -d '[:space:]') && \
sed -i "s|%%APP_VERSION%%|${APP_VERSION}|g" /usr/share/nginx/html/index.html
# Vendor libs (overwrite any existing copies in src/vendor/)
COPY --from=vendor /vendor/marked.min.js /usr/share/nginx/html/vendor/marked.min.js