giraffe-fsharp / Giraffe

A native functional ASP.NET Core web framework for F# developers.
https://giraffe.wiki
Apache License 2.0
2.12k stars 267 forks source link

Current template lacks fsproj items needed to run in official ASP.NET docker containers #487

Open lukemcdo opened 3 years ago

lukemcdo commented 3 years ago

Hello,

While I don't know if the Giraffe team would prefer to update the template or update the docs, currently the fsproj file needs the following lines added in order to run in the official ASP.NET Docker containers:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <!-- Previous items in the first property group -->
    **<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
    <AspNetCoreModuleName>AspNetCoreModuleV2</AspNetCoreModuleName>**
  </PropertyGroup>

I don't know what the oldest version of .NET Core and ASP.NET Core that support these two is, but I know they work in ASP.NET 3.1.

dustinmoris commented 2 years ago

Oh, thanks for bringing this to our attention! Have you got a pointer to an official ASP.NET Core documentation section which outlines why or when one needs this in order to work with the .NET Docker image? I'll add that to the docs then!

lukemcdo commented 2 years ago

I mean, the in-process part is a bit confusing, but it doesn't seem like it ever runs on Linux or Mac -- the best case is that on those platforms, ASP.NET might not respect the setting: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/in-process-hosting?view=aspnetcore-6.0

AspNetCoreModuleV1 is deprecated, so that's why that one should change.

OutOfProcess hosting works with IIS, but with slightly reduced performance. InProcess does not run on Linux or Mac at all, from what I can tell.

64J0 commented 1 year ago

Up.

Do you guys still think this is something we can add to the documentation?

surferjeff commented 12 months ago

I hit this issue in my first 10 minutes of learning F# & Giraffe. Quite baffling to a newbie. Yes, I ran dotnet publish -c Release in the first 10 minutes because I wanted to see the size of a simple Giraffe App.