fix(docker): revert to node:20-slim with 3GB memory
- Use node:20-slim for builder stage (better memory handling) - Keep node:20-alpine for runtime (smaller image) - Increase memory to 3072MB for build
This commit is contained in:
parent
897518c86e
commit
819ffef722
1 changed files with 7 additions and 7 deletions
14
Dockerfile
14
Dockerfile
|
|
@ -1,5 +1,5 @@
|
|||
# Multi-stage build with memory optimization
|
||||
FROM node:20-alpine AS builder
|
||||
# Multi-stage build - using slim for better compatibility
|
||||
FROM node:20-slim AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# Skip browser downloads
|
||||
|
|
@ -7,22 +7,22 @@ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
|||
ENV CYPRESS_INSTALL_BINARY=0
|
||||
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache python3 make g++
|
||||
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies with reduced memory
|
||||
# Install dependencies
|
||||
RUN npm install --legacy-peer-deps --prefer-offline --no-audit
|
||||
|
||||
# Copy source
|
||||
COPY . .
|
||||
|
||||
# Build with memory optimization (reduced from 4096 to 2048 for Alpine)
|
||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
||||
# Build with memory optimization (3GB for slim image)
|
||||
ENV NODE_OPTIONS="--max-old-space-size=3072"
|
||||
RUN npm run build
|
||||
|
||||
# Runtime stage
|
||||
# Runtime stage - use alpine for smaller size
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue