Enhance version management and Docker build system
- Add Docker build args for proper version detection in containers - Update build.sh script with smart version detection for Docker builds - Add --message option to new-version.js for custom commit messages - Fix Docker builds showing incorrect '-dev' suffix for release builds - Improve versioning workflow with comprehensive --check analysis
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,6 +1,10 @@
|
||||
# Build stage
|
||||
FROM node:24-alpine AS builder
|
||||
|
||||
# Accept build arguments for version info
|
||||
ARG VERSION=""
|
||||
ARG IS_RELEASE="false"
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
@@ -16,6 +20,17 @@ COPY public/ ./public/
|
||||
COPY scripts/ ./scripts/
|
||||
COPY server.js ./server.js
|
||||
|
||||
# Generate version.js if version info provided, otherwise run normal build
|
||||
RUN if [ -n "$VERSION" ]; then \
|
||||
echo "// Auto-generated version file - do not edit manually" > src/version.js && \
|
||||
echo "// Generated at: $(date -Iseconds)" >> src/version.js && \
|
||||
echo "" >> src/version.js && \
|
||||
echo "export const VERSION = '$VERSION';" >> src/version.js && \
|
||||
echo "export const IS_RELEASE = $IS_RELEASE;" >> src/version.js && \
|
||||
echo "export const BUILD_TIME = '$(date -Iseconds)';" >> src/version.js && \
|
||||
echo "📝 Generated version.js with VERSION=$VERSION, IS_RELEASE=$IS_RELEASE"; \
|
||||
fi
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user