pm2 monit
Is it possible to start a rails server with pm2?
In my ecosystem.config.js I've got something like:
{
name: 'rails-api',
script: 'bundle exec rails s -p 3001 -b 0.0.0.0',
cwd: './api',
interpreter: 'bash',
...
}
I've tried using bash and also setting interpreter to none
and running the binary ./api/bin/rails
--lib
option. I tries installing typescript with pm2 pm2 install typescript and it didn't work. Can anyoane suggest something, please?
I notice the part : Serve static file over HTTP.
I use the command: pm2 serve ./dist/ 8080
, and it be valid just for the SPA page (for the root index.html file, http://localhost:8080/
).
But I would like that it could also for other html files (like http://localhost:8080/other.html
or http://localhost:8080/me/about.html
). It just like a Nginx
(a server engine ).
The PM2 can do that ? and how should I do?
Hi guys, I have the following script to start my application, but I would like to know if I am indicating the parameters "-Xmx256m -Xms256m" ???:
{
"apps": [{
"name": "application",
"cwd": "/opt/application",
"args": [
"-jar",
"application.war"
],
"env": {
"SPRING_PROFILES_ACTIVE": "prod",
"JAVA_OPTS": "-Xmx256m -Xms256m"
},
"script": "/usr/bin/java",
"node_args": [],
"log_date_format": "YYYY-MM-DD HH:mm Z",
"exec_interpreter": "none",
"exec_mode": "fork"
}
]
}
thanks for your help
Hi I'm trying a use-case to be able to communicate between PM2 workers. There are some examples listed here:
Most of these examples use the sendDataToProcessId method
But then, the official docs:
https://pm2.keymetrics.io/docs/usage/pm2-api/#send-message-to-process
uses something called launchBus.
I could not find any further docs or usecases listed for launchBus
Could someone please elaborate on the purpose of launchBus and why does it need to be used along with sendDataToProcessId ?
Hi, did anyone ever run into this issue:
root@b7d29d49766a:/srv# pm2-runtime cisystem.config.cjs
2021-09-25T14:23:20: PM2 log: Launching in no daemon mode
2021-09-25T14:23:20: PM2 log: App [appname:0] starting in -cluster mode-
2021-09-25T14:23:20: PM2 log: App [appname-ci:0] online
Error: Could not find source file: '/srv/cisystem.config.cjs'.
at getValidSourceFile (/srv/node_modules/typescript/lib/typescript.js:153651:29)
at Object.getEmitOutput (/srv/node_modules/typescript/lib/typescript.js:154079:30)
at getOutput (/srv/node_modules/ts-node/src/index.ts:562:32)
at Object.compile (/srv/node_modules/ts-node/src/index.ts:775:32)
at Module.m._compile (/srv/node_modules/ts-node/src/index.ts:858:43)
at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Object.require.extensions.<computed> [as .js] (/srv/node_modules/ts-node/src/index.ts:861:12)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
Basically, it says that it can't find the ecosystem file that it must have found, because "appname" is from the file.
This is inside a docker container as you might have guessed from the hostname.