befly-tpl 3.4.13 → 3.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SYSTEMD_DEPLOY.md +8 -21
- package/package.json +3 -3
package/SYSTEMD_DEPLOY.md
CHANGED
|
@@ -138,19 +138,15 @@ sudo systemctl restart befly
|
|
|
138
138
|
|
|
139
139
|
## 配置说明
|
|
140
140
|
|
|
141
|
-
###
|
|
141
|
+
### 单进程模式
|
|
142
142
|
|
|
143
143
|
```ini
|
|
144
|
-
#
|
|
144
|
+
# Systemd 推荐单进程模式
|
|
145
145
|
ExecStart=/usr/local/bin/bun run befly start
|
|
146
|
-
|
|
147
|
-
# 选项2:自动集群模式(推荐,使用所有CPU核心)
|
|
148
|
-
ExecStart=/usr/local/bin/bun run befly start --cluster max
|
|
149
|
-
|
|
150
|
-
# 选项3:指定进程数(如4个进程)
|
|
151
|
-
ExecStart=/usr/local/bin/bun run befly start --cluster 4
|
|
152
146
|
```
|
|
153
147
|
|
|
148
|
+
**集群部署推荐使用 PM2**:Systemd 适合单进程部署,如需集群模式请使用 PM2(参见项目根目录的 PM2 相关文档)
|
|
149
|
+
|
|
154
150
|
### 用户和权限
|
|
155
151
|
|
|
156
152
|
```bash
|
|
@@ -193,18 +189,9 @@ EnvironmentFile=/var/www/befly/.env.production
|
|
|
193
189
|
|
|
194
190
|
### Nginx 配置示例
|
|
195
191
|
|
|
196
|
-
|
|
197
|
-
upstream befly_cluster {
|
|
198
|
-
# 集群模式下配置多个端口
|
|
199
|
-
server 127.0.0.1:3000;
|
|
200
|
-
server 127.0.0.1:3001;
|
|
201
|
-
server 127.0.0.1:3002;
|
|
202
|
-
server 127.0.0.1:3003;
|
|
203
|
-
|
|
204
|
-
# 负载均衡策略
|
|
205
|
-
least_conn; # 最少连接
|
|
206
|
-
}
|
|
192
|
+
#### 单进程模式
|
|
207
193
|
|
|
194
|
+
```nginx
|
|
208
195
|
server {
|
|
209
196
|
listen 80;
|
|
210
197
|
server_name yourdomain.com;
|
|
@@ -215,7 +202,7 @@ server {
|
|
|
215
202
|
# ssl_certificate_key /path/to/key.pem;
|
|
216
203
|
|
|
217
204
|
location / {
|
|
218
|
-
proxy_pass http://
|
|
205
|
+
proxy_pass http://127.0.0.1:3000;
|
|
219
206
|
proxy_http_version 1.1;
|
|
220
207
|
|
|
221
208
|
# WebSocket 支持
|
|
@@ -306,7 +293,7 @@ sudo systemd-analyze verify /etc/systemd/system/befly.service
|
|
|
306
293
|
|
|
307
294
|
# 测试启动命令
|
|
308
295
|
cd /var/www/befly
|
|
309
|
-
sudo -u www-data bun run befly start
|
|
296
|
+
sudo -u www-data bun run befly start
|
|
310
297
|
```
|
|
311
298
|
|
|
312
299
|
### 权限问题
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly-tpl",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.14",
|
|
4
4
|
"description": "Befly 3.0 TypeScript Template",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
],
|
|
33
33
|
"type": "module",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"befly": "^3.4.
|
|
35
|
+
"befly": "^3.4.13"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"bun": ">=1.3.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "f37b14e9acad47245d399709829013fda8a0c44e"
|
|
41
41
|
}
|