-
Notifications
You must be signed in to change notification settings - Fork 3
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
BREAKING CHANGE: Change default serve port to 3000 and add ability to override #265
Conversation
I understand that changing the default port can introduce some disruption. But it's a very common port for local web development. Hence, I still wanted to suggest it. Another major reason is https://stackoverflow.com/questions/69818376/localhost5000-unavailable-in-macos-v12-monterey/69829313#69829313 TL;DR some macOS service named AirPlay somehow utilizes the port 5000. And I actually encountered this problem myself. This could cause many errors for all macOS users in the future. |
Also, I'm afraid this affects the docker image. I couldn't find how it serves on port 8080 |
|
||
// See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#dotnet_running_in_container-and-dotnet_running_in_containers | ||
// This way use the default port when running in a container | ||
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER")) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking one will suffice 😸 both will be set (don't ask my why!).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm starting to wonder.
IIUC, the main reason for the differing ports for the native binary and the docker image are dotnet defaults.
Would it be a better UX if both use the same port?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://learn.microsoft.com/en-us/dotnet/core/compatibility/containers/8.0/aspnet-port has some background as to why its 8080.
In .net the default changes based on environments: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-9.0
Which is not something we leverage. Docker is a prod
environments hence the different port as the rest of the run environments which are dev
by default..
It makes sense to normalize this to one non privileged port and forego the docker env check to keep it simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly? We skip the environment check and always do UseUrls
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes thats the less long winded conclusion 😸
We'll have to update https://github.com/elastic/docs-builder-example or maybe we should archive that repository now that we have the migration repositories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #229
Changes
Changing default port to
3000
as it is a common port for local web development.Read more here: https://locall.host/3000/
Source: https://locall.host/3000/
However, this change also gives the ability to override the port if necessary.