新增 Service:MeTube
68
Service%EF%BC%9AMeTube.md
Normal file
68
Service%EF%BC%9AMeTube.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# 安裝相關套件
|
||||
|
||||
```bash
|
||||
apt update && apt install -y git nodejs npm curl ffmpeg
|
||||
```
|
||||
|
||||
# 下載 MeTube
|
||||
|
||||
```bash
|
||||
git clone https://github.com/alexta69/metube.git
|
||||
```
|
||||
|
||||
# 安裝 MeTube
|
||||
|
||||
## 前端
|
||||
|
||||
```bash
|
||||
cd ~/metube/ui && npm install && node_modules/.bin/ng build
|
||||
```
|
||||
|
||||
## 後端
|
||||
|
||||
```bash
|
||||
cd ~/metube && curl -LsSf https://astral.sh/uv/install.sh | sh && uv sync
|
||||
```
|
||||
|
||||
設定環境變數
|
||||
|
||||
```bash
|
||||
echo 'source $HOME/.local/bin/env' >> ~/.bashrc && source ~/.bashrc
|
||||
```
|
||||
|
||||
# 執行 MeTube
|
||||
|
||||
```bash
|
||||
uv run python3 app/main.py
|
||||
```
|
||||
|
||||
# 設計 MeTube 服務
|
||||
|
||||
```bash
|
||||
nano /etc/systemd/system/metube.service
|
||||
```
|
||||
|
||||
服務檔內容
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=MeTube
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/root/metube
|
||||
ExecStart=/root/.local/bin/uv run python3 app/main.py
|
||||
Restart=always
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
啟動服務
|
||||
|
||||
```bash
|
||||
systemctl daemon-reload && systemctl enable metube.service && systemctl start metube.service
|
||||
```
|
||||
|
||||
# 連接埠 8081
|
||||
Reference in New Issue
Block a user