[Unit]
Description=K-ArtSell Aegis - Financial Advisory System
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
User=kartsell
WorkingDirectory=/app/kartsell
ExecStart=/usr/bin/dotnet KArtSell.Host.dll
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal

# Environment variables
Environment="ASPNETCORE_ENVIRONMENT=Production"
Environment="ASPNETCORE_URLS=http://127.0.0.1:5002"

# Security
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=yes
ReadWritePaths=/app/kartsell/logs

# Resource limits
LimitNOFILE=65535
LimitNPROC=4096

[Install]
WantedBy=multi-user.target
