[Unit]
Description=Lingyue Zhibao - NER Python Service
Documentation=https://code.salesmap.tech/hewensong/lingyue-zhibao
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/mnt/win_home/lingyue-zhibao/python-services/ner-service

# 使用虚拟环境启动 (端口 18522)
ExecStart=/mnt/win_home/lingyue-zhibao/python-services/ner-service/venv/bin/uvicorn \
    app.main:app \
    --host 0.0.0.0 \
    --port 18522

# 重启策略
Restart=always
RestartSec=10

# 日志
StandardOutput=append:/var/log/lingyue/ner-service.log
StandardError=append:/var/log/lingyue/ner-service-error.log

# 环境变量
Environment=NER_MODEL=rule
Environment=LOG_LEVEL=INFO
Environment=MAX_TEXT_LENGTH=50000

# DeepSeek API (如需使用)
# Environment=DEEPSEEK_API_KEY=your_api_key_here

[Install]
WantedBy=multi-user.target
