I've been transferring some projects that have been executing on the same machine to individual dockers each. I've tried to use pm2
on one of these docker projects to make sure the service would restart if something go wrong (it's a volatile project) and some of the examples demands the Dockerfile to use pm2-runtime
instead of pm2
. I've been searching for the differences of these two but I couldn't find something specific, could someone help?
相关问题
- Docker task in Azure devops won't accept "$(pw
- Unable to run mariadb when mount volume
- Unspecified error (0x80004005) while running a Doc
- What would prevent code running in a Docker contai
- How to reload apache in php-apache docker containe
The main difference between pm2 and pm2-runtime is
In simple words, the life of the container is the life of
CMD
orentrypoint
.For example
Dockerfile
In this case, the container will die as soon as it run the process.
To deal with this, you have pm2-runtime
As the container keeps running and it allocates tty session.
From the documentation
docker-pm2-nodejs