#Bun.serve doesn’t work when providing hostname in docker?

1 messages · Page 1 of 1 (latest)

unreal birch
#

Any ideas why this doesn't work? See the screenshot. If I remove hostname: 'localhost' it works and the returned server object states 'localhost' as hostname. Running latest oven/bun:latest image.

smoky seal
#

I may be wrong but I'm pretty sure Docker containers don't map the hostname localhost to 127.0.0.1

#

You can map the network to the host network if that's the behaviour you need

unreal birch
#

I desire no specific behaviour, was just confused that with localhost it fails to start and without it, it doesnt. Even though bun returns localhost as bound hostname.... but I wasn’t aware of the docker localhost->127.0.0.1 behaviour, thanks for bringing this up @smoky seal 🙂