dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
dotnet publish -r linux-x64 -c Release /p:PublishSingleFile=true
sudo cat > /etc/systemd/system/test.service
# test.service
[Unit]
Description=Test api service
[Service]
WorkingDirectory=/var/www/www-root/data/www/test.net/test
ExecStart=/var/www/www-root/data/www/test.net/testapi/testapi --urls=http://localhost:5010
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=testapi
User=www-root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target