Fix Docker build version detection

- Skip prebuild step in Docker when VERSION build arg is provided
- Prevent version-check.js from overwriting pre-generated version.js in Docker
- Fix Docker containers showing incorrect '-dev' suffix for release builds
- Use direct react-scripts build when version is pre-generated
This commit is contained in:
2026-01-21 22:06:37 +01:00
parent c9ce0d14b9
commit e22b3c82a2
2 changed files with 9 additions and 3 deletions

View File

@@ -31,8 +31,14 @@ RUN if [ -n "$VERSION" ]; then \
echo "📝 Generated version.js with VERSION=$VERSION, IS_RELEASE=$IS_RELEASE"; \
fi
# Build the application
RUN npm run build
# Build the application (skip prebuild if we already generated version.js)
RUN if [ -n "$VERSION" ]; then \
echo "🚀 Building with pre-generated version.js" && \
npx react-scripts build; \
else \
echo "🚀 Building with version-check.js" && \
npm run build; \
fi
# Production stage
FROM node:24-alpine AS production