-
Notifications
You must be signed in to change notification settings - Fork 104
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
pm2 start #15
base: master
Are you sure you want to change the base?
pm2 start #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
butuh beberapa penyesuaian karena mengutamakan general use yaitu tidak semua menggunakan PM2 untuk production serta developer yang masih awam dan tidak terbiasa menggunakan PM2
README.md
Outdated
Start with PM2 ~ Tested with Ubuntu 20 server | ||
|
||
```bash | ||
# example of PATH_PM2 is /www/server/nodejs/v18.13.0/bin/pm2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ini malah bikin bingung pak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bagian mana pak?
|
||
```bash | ||
# example of PATH_PM2 is /www/server/nodejs/v18.13.0/bin/pm2 | ||
sudo PATH_PM2 start ecosystem.config.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lebih baik langsung panggil instance pm2 dibanding bingung nyari apa itu PATH_PM2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
karena ada beberapa server multiple nodejs pak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nodejs versioning udh dihandle sama nvm jadi tidak perlu install banyak nodejs dan install pm2 disetiap versi node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gak semua server punya nvm pak, saya termasuk, install nodejs manual.
# example of PATH_PM2 is /www/server/nodejs/v18.13.0/bin/pm2 | ||
sudo PATH_PM2 start ecosystem.config.js | ||
|
||
* FORK or CLUSTER ? -> readmore [here](https://stackoverflow.com/a/36177256) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sepertinya tidak urgent untuk memilih FORK atau CLUSTER pak, lebih baik default saja
apps : [ | ||
{ | ||
name : "Start WA-Gateway with PM2", | ||
script : "./index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer jalankan script yang ada di package.json supaya tidak call 2 kali
diganti "npm start" aja cukup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cukup 1 kalo pak. bisa pilih, yarn start
atau dengan pm2.
{ | ||
name : "Start WA-Gateway with PM2", | ||
script : "./index.js", | ||
instances : "1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instance tidak perlu karena default sudah 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
betul
name : "Start WA-Gateway with PM2", | ||
script : "./index.js", | ||
instances : "1", | ||
exec_mode : "fork", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tidak perlu karena default sudah mode FORK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
betul
script : "./index.js", | ||
instances : "1", | ||
exec_mode : "fork", | ||
env: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENV tidak perlu karena sudah di inisialkan pada file .env
ecosystem.config.js
Outdated
module.exports = { | ||
apps : [ | ||
{ | ||
name : "Start WA-Gateway with PM2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nama terlalu panjang dan tidak deskriptif, karena akan menjadi instance name pada list process pm2, prefer simple yang mewakili instance aplikasi yang berjalan seperti : "wa-gateway"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boleh pak
README.md
Outdated
@@ -46,6 +46,15 @@ Start the server | |||
npm run start | |||
``` | |||
|
|||
Start with PM2 ~ Tested with Ubuntu 20 server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cocoknya diganti "Or Start as Background Process with PM2: Process Manager (For Production)"
Kata OR dibutuhkan karena dapat memilih antara opsi diatasnya atau opsi ini
dan diberikan label "Optional" serta keterangan jika step ini hanya dibutuhkan jika butuh menjalankan pada production dan butuh berjalan pada backround process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sudah di up pak
optional pak, run project dengan nodejs biasa juga bisa masih, saya pake methode ini karena sering kali project crash, kalo di pm2 otomatis running kalo server mati |
ini contoh penggunaan dengan PM2 pak. mohon di acc yak.