-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sugestion - avoid pm2 in docker #2820
Comments
Thanks for opening this issue! A maintainer will review this in the next few days and explicitly select labels so you know what's going on. If no reviewer appears after a week, a reminder will be sent out. |
From
|
The post you linked already answers your question. If you start a node.js script and it crashes then the whole container will go down with it and you need to setup restart policies to get it back up in such cases. pm2 is a no-brainer to run in and outside of docker for our use-case so that is what we are going with as it doesn't require any special docker configuration to keep the process running if it crashes. |
This issue has been closed. If you wish to re-open it please provide additional information. |
@faustbrian the use of docker is single-process app that you allow to die when it dies, and use docker-compose/kubernetes/whatever to handle those cases. Current dockerfile is not production ready, but a sandbox toy to play with, and can't be considered to use in any serious infra sadly. I would like to help on this one, but we need to have that desire from both of us :) |
I removed pm2 part from dockerfile like this:
And replaced start script with TY for having relay:run script |
In our implementation those lines:
have to be run by entrypoint.sh as those paths are mounted as volumes on container start. We need to keep things compatible for everyone and not target only large scale container deployments. |
@adrian69 TY for explainig, now I see the reason. Can you please tell why you use volumes for this? What information shoud be persistent while docker restarts? My current docker container restarted ~10 times (as I updated the configs) and seems to work fine without any data stored on volumes. |
Same reason what @faustbrian mentioned in: Our goal is user experience to be as close as possible to a native core node. Having that said, logs being accessible locally is necessary. |
You are free to build your own images if those provided by ARK does not fit your environment. Basically this is why we provided: |
@adrian69 sorry, I just don't get it. Those locations store logs? :
Can you please point me to the doc, where I would find what is supposed to be there? |
That is global path and naming convention used by ARK. From point of end user view we try to keep it as simple as possible so code can be run on any computer. So in general one would run the code with docker and can find everything locally as if it would have been running a native node. It doesn't mean they are supposed to be there. It means this is our implementation and we have certain reasons to build it that way. Everyone is free to have his own implementation and not necessarily to use images provided by ARK. I'm sure professional like you would find his way to make it running in a production containerized environment. |
@adrian69 ah, so you mean runing with docker and without ON THE SAME INSTANCE ? Now I think I get it, sorry that it took me so long :) Would you consider some PRs for kuber-ready dockerfiles, or you don't need it? I already have built my own images, and use them, was only wondering why you had that weird scheme. The only thing left is to understand why it doesn't start listening on an api port. |
ON THE SAME INSTANCE would generally not be applicable because of conflict ports and multiple nodes with a single public ip address (unless you use different floating IPs per container and map external ports to specific container internal address) if i got you right. As for kubernetes ready stuff i'll have to discuss it with my colleagues prior to answer. |
It is a very unstable and uncomfortable way - to run
pm2
inside docker (For example - https://stackoverflow.com/questions/51191378/what-is-the-point-of-using-pm2-and-docker-together).Can you please provide instructions on how to run process without pm2? With plain node for example?
The text was updated successfully, but these errors were encountered: