Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bolero ignores ASPNETCORE_HTTP_PORTS environment variable #352

Open
MichaelMay81 opened this issue Apr 16, 2024 · 3 comments
Open

Bolero ignores ASPNETCORE_HTTP_PORTS environment variable #352

MichaelMay81 opened this issue Apr 16, 2024 · 3 comments

Comments

@MichaelMay81
Copy link

I want to deploy Bolero in the aspnet docker image from Microsoft.
This needs the app to listen on port 8080. The image enforces this with the env variable ASPNETCORE_HTTP_PORTS.
But Bolero seems to ignore this.

Anyone know how do I get this env variable to work?
Or a workaround?

@MichaelMay81
Copy link
Author

One way to activate this, was to add it by hand:

match System.Environment.GetEnvironmentVariable "ASPNETCORE_HTTP_PORTS" with | null -> () | port -> webHost.UseUrls $"http://localhost:{port}" |> ignore

@Tarmil
Copy link
Member

Tarmil commented Apr 16, 2024

Hmm, normally this should work. The Bolero project template uses WebApplication.CreateBuilder, just like standard ASP.NET Core templates, and not the older WebHost.CreateDefaultBuilder that the documentation says doesn't support ASPNETCORE_HTTP_PORTS.

@Bananas-Are-Yellow
Copy link

Bananas-Are-Yellow commented Jun 14, 2024

I just tried the latest template (version 0.23.19) and it seems to use the older WebHost.CreateDefaultBuilder.

According to dotnet new update --check-only, version 0.23.19 is the latest project template, but I can see newer versions here:

https://github.com/fsbolero/Template/releases

How do I get these newer versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants