feat: Enhance Docker build versioning with a build argument, fetch git tags during deployment, and add comprehensive deployment documentation.

This commit is contained in:
Hördle Bot
2025-11-25 10:15:47 +01:00
parent ce413cf6bc
commit 54af256e91
3 changed files with 98 additions and 2 deletions

View File

@@ -14,14 +14,22 @@ RUN npm ci
FROM base AS builder
WORKDIR /app
# Accept version as build argument (optional)
ARG APP_VERSION=""
# Install git to extract version information
RUN apk add --no-cache git
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Extract version from git
RUN git describe --tags --always 2>/dev/null > /tmp/version.txt || echo "unknown" > /tmp/version.txt
# Extract version: use build arg if provided, otherwise get from git
RUN if [ -n "$APP_VERSION" ]; then \
echo "$APP_VERSION" > /tmp/version.txt; \
else \
git describe --tags --always 2>/dev/null > /tmp/version.txt || echo "unknown" > /tmp/version.txt; \
fi && \
echo "Building version: $(cat /tmp/version.txt)"
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry