My Dockerfile
contains the pm2 start
command as follows:
FROM node:10
WORKDIR /usr/src/app
COPY . .
# ...
EXPOSE 8080
CMD [ "pm2", "start", "npm", "--", "start" ]
However the container exits straightaway after pm2 logs successfully starting:
[PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /usr/local/bin/npm in fork_mode (1 instance)
[PM2] Done.
How can I get the container to stay running with pm2?
CMD [ "pm2-runtime", "npm", "--", "dev" ]
The project is graphql prisma with typescript. This is the package.json's npm dev:"dev": "ts-node-dev --no-notify --respawn --transpile-only src/server",
– Robson