[Unit]
Description=Lingyue Zhibao - Extract Service (Template System)
Documentation=https://code.salesmap.tech/hewensong/lingyue-zhibao
After=network.target postgresql.service

[Service]
Type=simple
User=root
WorkingDirectory=/mnt/win_home/lingyue-zhibao/backend

# Java 启动命令 (端口 18521)
ExecStart=/usr/bin/java \
    -Xms512m -Xmx1g \
    -XX:+UseG1GC \
    -Dfile.encoding=UTF-8 \
    -Dserver.port=18521 \
    -jar extract-service/target/extract-service.jar

# 重启策略
Restart=always
RestartSec=10

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

# 环境变量
Environment=JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
Environment=SPRING_PROFILES_ACTIVE=prod

# 数据库配置
Environment=DB_HOST=localhost
Environment=DB_PORT=5432
Environment=DB_NAME=lingyue_zhibao
Environment=DB_USERNAME=lingyue
Environment=DB_PASSWORD=123123

[Install]
WantedBy=multi-user.target
