Error starting node with forever in docker container

I have a problem when start node with forever in docker container, if i launch manually works, instead the same command in Dockerfile, when build and start the container, exited. The command works in bash:

forever start -c ‘node --harmony’ /my/path/app.js

I tried to put command in Dockerfile but the container don’t start

CMD forever start -c ‘node --harmony’ /my/path/app.js

I have tried also with:

CMD [“forever”,“start”,"-c","‘node --harmony’","/my/path/app.js"]


CMD [“forever”,“start”,"-c",“node --harmony”,"/my/path/app.js"]

But don’t work, any idea?

Sorry, I havn’t gotten to this (on google groups either) as the information you’ve provided isn’t enough to me to quickly duplicate it.

If you post your entire Dockerfile and source, or a simplified version of your code / similar, then someone might get there faster :smile:

Forever starts the node app in the background. If no processes are active running in the foreground the container will exit.
Please refer to this stack overflow thread for more details:

Try something like this:
CMD [“forever”, “-c”,“node --harmony”,"/my/path/app.js"]