We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b59942a commit 72ff028Copy full SHA for 72ff028
Dockerfile
@@ -3,6 +3,13 @@ FROM node:lts-alpine AS build-stage
3
# Set environment variables for non-interactive npm installs
4
ENV NPM_CONFIG_LOGLEVEL warn
5
ENV CI true
6
+
7
+# Detect available memory and set NODE_OPTIONS with buffer of 128MB
8
+RUN memory=$(awk '/MemTotal/{print $2}' /proc/meminfo); \
9
+ memory=$((memory / 1024 / 1024)); \
10
+ node_options="--max-old-space-size=$((memory - 128))"; \
11
+ export NODE_OPTIONS="$node_options";
12
13
WORKDIR /app
14
COPY package.json pnpm-lock.yaml ./
15
RUN npm install -g pnpm && pnpm i --frozen-lockfile
0 commit comments