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 · 2 comments
Open

Bolero ignores ASPNETCORE_HTTP_PORTS environment variable #352

MichaelMay81 opened this issue Apr 16, 2024 · 2 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.

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

2 participants