IsidoreSoftware / MagicMirror

Mirror that will be your best morning assistant.
GNU Lesser General Public License v3.0
2 stars 0 forks source link

PoC - ASP.NET Core API on ARM #3

Closed matjanos closed 7 years ago

matjanos commented 7 years ago
  1. install nginx

  2. build API on dev machine

  3. copy binaries to RaspberyPI

  4. change *.runtimeconfig.json file to use your Mictosoft.NETCore.App version. f.e:

    {                                           
    "runtimeOptions": {                       
    "framework": {                          
      "name": "Microsoft.NETCore.App",      
      "version": "1.2.0-beta-001291-00"     
    },                                      
    "configProperties": {                   
      "System.GC.Server": true              
    }                                       
    }                                         
    }                                           
  5. Replace System libraries to correct version:

    cp /opt/dotnet/shared/Microsoft.NETCore.App/1.2.0-beta-001291-00/System.ComponentModel.Primitives.dll .   
    cp /opt/dotnet/shared/Microsoft.NETCore.App/1.2.0-beta-001291-00/System.ComponentModel.TypeConverter.dll .       
    cp /opt/dotnet/shared/Microsoft.NETCore.App/1.2.0-beta-001291-00/System.Collections.Specialized.dll .
    cp /opt/dotnet/shared/Microsoft.NETCore.App/1.2.0-beta-001291-00/System.Linq.dll .                        
  6. Change nginx config /etc/nginx/sites-available/default to:

    server {
    listen 80;
    location / {
        proxy_pass http://localhost:5000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection keep-alive;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    }
  7. Reload nginx by sudo nginx -s reload

Refs: https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction https://github.com/dotnet/coreclr/issues/9168 https://github.com/dotnet/core/blob/master/release-notes/rc4-download.md https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md