From 7fe7a520de9a9e0faf35e15ffe11a0f0d7d39663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Tue, 5 Mar 2024 22:23:24 +0800 Subject: [PATCH] feat: install pm2 on dev --- dev/manually/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dev/manually/README.md b/dev/manually/README.md index 8a5fe70f82..5da28d68b9 100644 --- a/dev/manually/README.md +++ b/dev/manually/README.md @@ -146,6 +146,7 @@ nano .config/default.yml sudo -i # cd /path/to/your/firefish cd /home/user/firefish +npm i -g pm2 corepack enable exit ``` @@ -154,9 +155,13 @@ exit ```sh corepack prepare pnpm@latest --activate +pm2 install pm2-logrotate pnpm install --frozen-lockfile --prod false ``` +> **Note** +> [`pm2-logrotate`](https://github.com/keymetrics/pm2-logrotate/blob/master/README.md) ensures that log files don't infinitely gather size, as Firefish produces a lot of logs. + ## Start 1. Build and migrate @@ -182,3 +187,11 @@ DONE * [core boot] Now listening on port 3030 on https://your_firefish_url. ``` 3. A fresh Firefish environment is created on the URL you have set! + +4. If you want Firefish to run in the background, start it with this command. + +```sh +pm2 start "NODE_ENV=production pnpm run start" --name Firefish +# When you want display log +pm2 logs Firefish +```