From 64927417573cf1a7ed4fa8cf613612e7de47578f Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Wed, 11 Feb 2026 21:50:16 +0000 Subject: [PATCH] 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 --- .drone.yml | 10 ++++++++++ frontend/Dockerfile | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index a10041a..80a9a5b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,6 +23,11 @@ steps: - name: Cache builder stage image: plugins/docker + resources: + requests: + memory: 1Gi + limits: + memory: 2Gi settings: username: viktorbarzin password: @@ -38,6 +43,11 @@ steps: - name: Build frontend image image: plugins/docker + resources: + requests: + memory: 1Gi + limits: + memory: 2Gi settings: username: viktorbarzin password: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index a1a7089..bd79e8e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -7,11 +7,13 @@ WORKDIR /app COPY package.json package-lock.json* ./ # Install dependencies (prefers yarn if available) -RUN npm ci +RUN npm ci # Copy all files and build COPY . . +# Limit Node.js heap to avoid OOM in constrained CI environments +ENV NODE_OPTIONS="--max-old-space-size=512" RUN npm run build FROM nginx:alpine