skip to Main Content

I have a blazor server app that I want to run on a raspberry pi. So far it is all good, I installed it as a service and the service is running like it should. I published the solution to srv/myApp and I have a .service config for it. The only thing missing is the serving of the wwwroot folder. When I open the app all the styles are missing. I have UseStaticFiles() enabled. When I run it locally or just build the project with dotnet run I get the styles from wwwroot. The wwwroot folder does exist in the published folder, though. It somehow just does not make it to my browser. I wanted to avoid running everything in nginx or something as I want to use the self hosting features.

Does anybody see what I am missing here? This is the project, if someone wants to take a look: https://github.com/modmoto/Deploynator

2

Answers


  1. Chosen as BEST ANSWER

    Ok, i finally found my issue, not all too firm with services on linux. What was missing was the following entry in my service file:

    WorkingDirectory=/srv/Deploynator

    So my complete .service file looks like this now:

    [Unit]
    Description=Deploynator service
    
    [Service]
    Type=notify
    ExecStart=/srv/Deploynator/Deploynator
    SyslogIdentifier=Deploynator
    WorkingDirectory=/srv/Deploynator
    
    User=pi
    
    Environment=DOTNET_ROOT=/opt/dotnet
    Environment="ASPNETCORE_URLS=http://0.0.0.0:5000/"
    
    [Install]
    WantedBy=multi-user.target
    

    Hope that this helps someone some day =)


  2. If you use a program such as Supervisor to drive your service, be sure to set the working directory

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search