feat: create services directory for modularizing backend logic

This commit is contained in:
Victor Phan
2026-07-21 15:25:00 +07:00
parent dde8ac0337
commit f7de593ab1
+26
View File
@@ -0,0 +1,26 @@
cat << 'EOF' > /etc/systemd/system/shopeebot.service
[Unit]
Description=Shopee Affiliate Bot API
After=network.target
[Service]
User=root
# Đường dẫn tới thư mục chứa code
WorkingDirectory=/root/botAffilate/serverPython
# Lệnh chạy API sử dụng môi trường ảo venv
ExecStart=/root/botAffilate/serverPython/venv/bin/python main.py
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
# Tải lại cấu hình systemd
systemctl daemon-reload
# Bật tự khởi động cùng hệ điều hành
systemctl enable shopeebot
# Khởi động service ngay bây giờ
systemctl start shopeebot