We are currently encountering a build issue during the deployment of our application on AWS ECS. The error message indicates that the npm process is being terminated unexpectedly with the signal SIGKILL, suggesting a potential out-of-memory situation.
Here is an overview of the relevant details:
Error Message
npm ERR! command failed npm ERR! signal SIGKILL
Probable Cause:
The issue seems to be related to the --max-old-space-size option, which is used to set the maximum heap size for Node.js. The value currently set to 9048.
Dockerfile (Dev Environment)
Docker File
# Development
Use the official Node.js image for development
FROM node:18-alpine
Set working directory
WORKDIR /app
Copy package.json and package-lock.json to the container
COPY package*.json ./
Install dependencies
RUN npm install
Copy the whole application to the container
COPY . .
Generate Prisma Client
RUN npx prisma generate
Start the NestJS server in development mode
CMD ["npm", "run", "start:dev"]
Application Start Command (package.json):**
"start:dev": "NODE_OPTIONS=--max-old-space-size=9048 nest start"
Tech Stack:
Nest.js
GraphQL
Prisma
PostgreSQL
Please let me know if anyone can help me on this one.