The app deploys and runs just fine locally for long periods of time without issue. On Amazon ECS, however, it seems to always crash after running idle for roughly 2:30 min. What's wrong?
Dockerfile
# Set the node alpine base image
FROM node:15-alpine
# Establish app working directory
WORKDIR /app
# Setup app workspace
COPY app.js .
COPY package.json .
COPY package-lock.json .
COPY app/ app
# Install app dependencies
RUN npm install
# Document listener port
EXPOSE 80
# Run listener
CMD [ "npm", "start" ]
Amazon ECS task logs
2021-06-05 17:33:20 npm ERR! A complete log of this run can be found in:
2021-06-05 17:33:20 npm ERR! /root/.npm/_logs/2021-06-05T15_33_20_563Z-debug.log
2021-06-05 17:33:20 npm ERR! command failed
2021-06-05 17:33:20 npm ERR! signal SIGTERM
2021-06-05 17:33:20 npm ERR! command sh -c node app
2021-06-05 17:33:20 npm ERR! path /app
2021-06-05 17:33:20 npm notice
2021-06-05 17:33:20 npm notice New minor version of npm available! 7.7.6 -> 7.16.0
2021-06-05 17:33:20 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.16.0>
2021-06-05 17:33:20 npm notice Run `npm install -g npm@7.16.0` to update!
2021-06-05 17:33:20 npm notice
2021-06-05 17:30:50 Server started at 0.0.0.0:80 ..
2021-06-05 17:30:46 > demo@1.0.0 start
2021-06-05 17:30:46 > node app