I am trying to start an existing MEAN stack app in a Docker container by using the following Docker command:
CMD ["pm2-runtime", "-i", "3", "npm", "--", "run-script", "start:prod"]
That command does start 3 PM2 instances, however it seems that the npm portion is not running the run-script part and it hangs with the following message in each instance:
Usage: npm <command>
where <command> is one of:
access, adduser, bin, bugs, c, cache, completion, config,
ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get,
help, help-search, i, init, install, install-test, it, link,
list, ln, login, logout, ls, outdated, owner, pack, ping,
prefix, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, tag, team, test, tst, un, uninstall,
If I remove the "-i", "3" portion, it correctly starts 1 instance of the app in "fork" mode.
Anyone know what would be the correct syntax for starting 3 instances, considering its using NPM with a run-script?
Thank you
Add
"start"
to CMD line