Skip to content

Conversation

@dumbasPL
Copy link
Contributor

@dumbasPL dumbasPL commented Sep 11, 2024

By default, the HOSTNAME environment variable will have the container's hostname. NodeJS server.listen when used with a hostname that resolved to multiple addresses will only use the first one. By setting it to 0.0.0.0 we are restoring the default behavior of Next.js and listening on all interfaces.

fixes #285

Edit: not sure if stating it like this allows the user to overwrite it

@dumbasPL dumbasPL marked this pull request as draft September 13, 2024 23:21
@Ravinou Ravinou marked this pull request as ready for review November 2, 2024 10:51
@Ravinou
Copy link
Owner

Ravinou commented Nov 2, 2024

not sure if stating it like this allows the user to overwrite it

Having tested it, you can't override the environment variable. But are people using ipv6 as Docker's internal network protocol? That's the question. Otherwise, this PR is ok for me.

@Ravinou
Copy link
Owner

Ravinou commented Nov 2, 2024

Can you rebase and target the develop branch please ? Thank you.

@dumbasPL
Copy link
Contributor Author

dumbasPL commented Nov 3, 2024

But are people using ipv6 as Docker's internal network protocol?

Nobody sane. Like, It's possible in theory, but it's a massive PITA to do and maintain. I only have v6 on my reverse proxy.

By default, the `HOSTNAME` environment variable will have the
container's hostname. NodeJS `server.listen` when used with a
hostname that resolved to multiple addresses will only use the
first one. By setting it to 0.0.0.0 we are restoring the default
behavior of Next.js and listening on all interfaces.
@dumbasPL dumbasPL changed the base branch from main to develop November 3, 2024 16:38
@Ravinou
Copy link
Owner

Ravinou commented Nov 3, 2024

So, I'll accept it and I will document it. Thank you :)

@Ravinou Ravinou merged commit 8cdbb50 into Ravinou:develop Nov 3, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

Web server doesn't bind to all addresses in docker

2 participants