Migrate to Vite 7, improve UI (Copy/Download), and enhance API security
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -14,31 +14,16 @@ COPY package*.json ./
|
||||
# Install dependencies (production + dev for build)
|
||||
RUN npm ci
|
||||
|
||||
# Copy source code and build scripts
|
||||
# Copy source code and build dependencies
|
||||
COPY src/ ./src/
|
||||
COPY public/ ./public/
|
||||
COPY scripts/ ./scripts/
|
||||
COPY server.js ./server.js
|
||||
COPY vite.config.js ./vite.config.js
|
||||
COPY index.html ./index.html
|
||||
|
||||
# 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 (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
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM node:24-alpine AS production
|
||||
|
||||
Reference in New Issue
Block a user