Fix frontend Docker build OOM: limit Node heap + request more memory

- Set NODE_OPTIONS=--max-old-space-size=512 in Dockerfile to cap tsc
  heap usage within constrained CI pods
- Add resource requests (1Gi) and limits (2Gi) to frontend Docker
  build steps in Drone pipeline
This commit is contained in:
Viktor Barzin 2026-02-11 21:50:16 +00:00
parent 34f70b2ba4
commit 6492741757
No known key found for this signature in database
GPG key ID: 0EB088298288D958
2 changed files with 13 additions and 1 deletions

View file

@ -23,6 +23,11 @@ steps:
- name: Cache builder stage - name: Cache builder stage
image: plugins/docker image: plugins/docker
resources:
requests:
memory: 1Gi
limits:
memory: 2Gi
settings: settings:
username: viktorbarzin username: viktorbarzin
password: password:
@ -38,6 +43,11 @@ steps:
- name: Build frontend image - name: Build frontend image
image: plugins/docker image: plugins/docker
resources:
requests:
memory: 1Gi
limits:
memory: 2Gi
settings: settings:
username: viktorbarzin username: viktorbarzin
password: password:

View file

@ -12,6 +12,8 @@ RUN npm ci
# Copy all files and build # Copy all files and build
COPY . . COPY . .
# Limit Node.js heap to avoid OOM in constrained CI environments
ENV NODE_OPTIONS="--max-old-space-size=512"
RUN npm run build RUN npm run build
FROM nginx:alpine FROM nginx:alpine