Files
ewoooc/momo.service
ogt 1b4f3a7bbe
Some checks failed
CD Pipeline / deploy (push) Failing after 59s
feat: EwoooC 初始化 — 完整專案推版至 Gitea
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml)
- 部署模式: rsync Python 檔案至 188 → docker restart (volume mount)
- Dockerfile/requirements 變動時自動重建 Docker image
- 部署通知: Telegram (開始/成功/失敗)
- 健康檢查: https://mo.wooo.work/health (最多 5 次重試)
- 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 01:21:13 +08:00

35 lines
919 B
Desktop File

[Unit]
Description=Momo Pro System - Flask Application
After=network.target
[Service]
Type=simple
User=ogt
WorkingDirectory=/home/ogt/momo_pro_system
Environment="PATH=/home/ogt/momo_pro_system/venv/bin"
# V-Fix: 啟動前確保清理所有舊的 gunicorn 進程
ExecStartPre=/bin/bash /home/ogt/momo_pro_system/kill_old_gunicorn.sh
ExecStart=/home/ogt/momo_pro_system/venv/bin/gunicorn \
--workers 4 \
--threads 2 \
--timeout 120 \
--graceful-timeout 30 \
--bind 127.0.0.1:5000 \
--access-logfile /home/ogt/momo_pro_system/logs/gunicorn-access.log \
--error-logfile /home/ogt/momo_pro_system/logs/gunicorn-error.log \
--log-level info \
app:app
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
# V-Fix: 優雅關閉設定,避免端口佔用問題
KillMode=mixed
KillSignal=SIGTERM
TimeoutStopSec=60
SendSIGKILL=yes
[Install]
WantedBy=multi-user.target