node.js - cannot pm2 list in docker containers -
i build docker image node.js , pm2. started container with:
docker run -d --name test -p 22 myimage
then go inside container with:
docker exec -it test /bin/bash
in container, exec command:
pm2 list
and stuck here:
p.s.: application works in docker container, if add cmd pm2 start app.js
in dockerfile
.
if dockerfile cmd pm2 command, have include --no-daemon arg option pm2 runs in foreground , docker container continues run.
an example dockerfile cmd:
cmd ["pm2", "start", "app.js", "--no-daemon"]
otherwise, without --no-daemon, pm2 launches background process , docker thinks execution of pm2 command done running , stops.
Comments
Post a Comment