[Unit]
Description=DuoBiBi Mock Backend (FastAPI / uvicorn)
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/duobibi-server
Environment="PATH=/opt/duobibi-server/.venv/bin:/usr/bin:/bin"
ExecStart=/opt/duobibi-server/.venv/bin/uvicorn app.main:app --host 127.0.0.1 --port 8766 --workers 1 --log-level info
Restart=on-failure
RestartSec=3

# 安全收紧
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ReadWritePaths=/opt/duobibi-server
ProtectHome=true

[Install]
WantedBy=multi-user.target
