mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-03 18:22:57 +00:00
dev day #67
This commit is contained in:
+12
-3
@@ -1,5 +1,5 @@
|
||||
# Build stage
|
||||
FROM node:18-alpine as build
|
||||
FROM node:18-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -18,8 +18,17 @@ COPY . .
|
||||
ENV NODE_ENV=production
|
||||
# Disable ESLint during build to avoid CRA/ESLint v9 plugin incompatibilities
|
||||
ENV DISABLE_ESLINT_PLUGIN=true
|
||||
# Workaround for OpenSSL error with webpack on Node 18
|
||||
ENV NODE_OPTIONS=--openssl-legacy-provider
|
||||
# Disable source maps to reduce memory usage
|
||||
ENV GENERATE_SOURCEMAP=false
|
||||
# Reduce memory footprint - use 1.5GB with smaller semi-space for better GC
|
||||
ENV NODE_OPTIONS="--openssl-legacy-provider --max-old-space-size=1536"
|
||||
# Limit webpack parallelism to reduce memory usage
|
||||
ENV CI=true
|
||||
|
||||
# Clean npm cache before build to free up memory
|
||||
RUN npm cache clean --force 2>/dev/null || true
|
||||
|
||||
# Build with memory optimization
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm run build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user