fix(version): inject APP_VERSION via Docker build-arg instead of git describe
In Docker builds, .git directory is not available in the container,
so git describe --tags fails and fallback is '0.0.0'. Now:
- build.sh passes --build-arg APP_VERSION=${tag} to frontend build
- Dockerfile accepts ARG APP_VERSION and sets ENV
- vite.config.js checks process.env.APP_VERSION first, then git describe
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
# ── Stage 1: Build Frontend ────────────────────────────────
|
||||
FROM node:20-alpine AS frontend-builder
|
||||
ARG APP_VERSION=0.0.0
|
||||
ENV APP_VERSION=${APP_VERSION}
|
||||
|
||||
WORKDIR /app/frontend
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
# #endregion docker.frontend.Dockerfile
|
||||
|
||||
FROM node:20-alpine AS build
|
||||
ARG APP_VERSION=0.0.0
|
||||
ENV APP_VERSION=${APP_VERSION}
|
||||
WORKDIR /app/frontend
|
||||
|
||||
COPY frontend/package*.json ./
|
||||
|
||||
Reference in New Issue
Block a user