Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I’m running a Node.js API as a service and while historically it ran perfectly fine. But recently it keeps failing with this error:
[2021-07-27 23:31:06]
[2021-07-27 23:31:06] INFO[0045] Taking snapshot of full filesystem...
[2021-07-27 23:31:41] INFO[0080] Pushing layer <registry-uri-3> to cache now
[2021-07-27 23:31:41] INFO[0080] Pushing image to <registry-uri-4>
[2021-07-27 23:31:41] INFO[0081] COPY . .
[2021-07-27 23:31:41] INFO[0081] Taking snapshot of files...
[2021-07-27 23:31:41] INFO[0081] ENV NODE_ENV production
[2021-07-27 23:31:41] INFO[0081] No files changed in this command, skipping snapshotting.
[2021-07-27 23:31:41] INFO[0081] RUN npm run build
[2021-07-27 23:31:41] INFO[0081] cmd: /bin/sh
[2021-07-27 23:31:41] INFO[0081] args: [-c npm run build]
[2021-07-27 23:31:41] INFO[0081] Running: [/bin/sh -c npm run build]
[2021-07-27 23:31:42]
[2021-07-27 23:31:42] > api@1.0.0 build /app
[2021-07-27 23:31:42] > tsc
[2021-07-27 23:31:42]
[2021-07-27 23:32:19] INFO[0119] Pushed image to 1 destinations
[2021-07-27 23:32:30]
[2021-07-27 23:32:30] <--- Last few GCs --->
[2021-07-27 23:32:30]
[2021-07-27 23:32:30] [213:0x55d1a5f5ee40] 46077 ms: Mark-sweep (reduce) 1019.1 (1025.9) -> 1018.2 (1027.2) MB, 659.1 / 0.0 ms (average mu = 0.197, current mu = 0.064) allocation failure scavenge might not succeed
[2021-07-27 23:32:30] [213:0x55d1a5f5ee40] 46819 ms: Mark-sweep (reduce) 1019.2 (1026.2) -> 1018.3 (1027.2) MB, 703.1 / 0.0 ms (average mu = 0.127, current mu = 0.053) allocation failure scavenge might not succeed
[2021-07-27 23:32:30]
[2021-07-27 23:32:30]
[2021-07-27 23:32:30] <--- JS stacktrace --->
[2021-07-27 23:32:30]
[2021-07-27 23:32:30] FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
[2021-07-27 23:32:30] error building image: error building stage: failed to execute command: waiting for process to exit: signal: aborted
[2021-07-27 23:32:30]
[2021-07-27 23:32:30] command exited with code 1
[2021-07-27 23:32:34] ! Build failed (exit code 1)
It works completely fine locally.
Does anyone know what could be going on here?
This is the startup script:
node --max-old-space-size=4096 build/src/index.js
Dockerfile:
FROM node:14-alpine
WORKDIR /app
COPY ./package.json ./
RUN npm install
COPY . .
ENV NODE_ENV production
RUN npm run build
CMD ["npm", "run", "start"]
a6309a057c3f4cb38fb2e7feb67236
KFSys
ef1ed44cc2154be3bcbb2d727878f8
Devs Neonetworks
1e6b823ea20d4cb189a34a922f5588
Telmo Valverde
erik-jan martens
Henry Mui
anthonycarreon
garantieheld
Marin