-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.service
33 lines (24 loc) · 1.01 KB
/
template.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[Unit]
Description=example.com Kestrel Service
[Service]
# application will notify systemd when it's ready and when it's stopping
Type=notify
WorkingDirectory=/var/www/example.com/www
# systemd will run this executable to start the service
# if /usr/bin/dotnet doesn't work, use `which dotnet` to find correct dotnet executable path
ExecStart=/usr/bin/dotnet /var/www/example.com/www/WebApplication.dll
# ensure the service restarts after crashing
Restart=always
# amount of time to wait before restarting the service
RestartSec=10
KillSignal=SIGINT
# to query logs using journalctl, set a logical name here
SyslogIdentifier=dotnet-example-com
# Use your username to keep things simple.
# If you pick a different user, make sure dotnet and all permissions are set correctly to run the app
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
Environment=ASPNETCORE_URLS=http://localhost:5000
[Install]
WantedBy=multi-user.target