SAFE-Stack / SAFE-template

dotnet CLI template for SAFE project
MIT License
282 stars 87 forks source link

Move default deployment to Linux OS #477

Closed Akash-Mair closed 1 year ago

Akash-Mair commented 2 years ago

Linux based apps are cheaper to run. We can create a recipe on how to move to Windows OS.

isaacabraham commented 2 years ago

I'm fully in favour of this - Linux is around 4x cheaper than Windows on App Service.

This would need update to Farmer and some minor changes to the template e.g. port number but otherwise not a lot. @theimowski what do you think?

The only other things we need to change are:

theimowski commented 2 years ago

Fine with me 👍

isaacabraham commented 2 years ago

Other observation we've learned recently:

  1. Only one free Linux service plan per region / subscription. Unlimited free on Windows.
theprash commented 1 year ago

Two changes are required to get the app working on a Linux app service:

The second change also requires further changes to keep things working in the dev environment (replacing port 8085 with 5000 in launchSettings.json and webpack.config.js). The port number also needs to be updated in SAFE docs.

theprash commented 1 year ago

I have a new PR #528 (which I propose we use instead of #498) which makes the changes described in my previous comment but doesn't actually set Linux as the OS.

I'll open a PR to update the docs. We might need to mention in the docs that there are 2 possible ports depending on your SAFE template version.

theprash commented 1 year ago

Do we definitely want to enable Linux by default given the restriction to just one free Linux instance? The good news is that after my PR, the recipe to switch to Linux is a 1-line change.

Another option is we stick to Windows as a default but add it explicitly in Farmer rather than relying on an implicit default. That way it might more obvious how to switch to Linux and we wouldn't even need a recipe.