Configuring the expected address the app should listen on

Here’s the issue I have in terminal.

WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.d6bd564e8 [app] update finished: success
You can fix this by configuring your app to listen on the following addresses:
  - 0.0.0.0:3000

However, it doesn’t say where and how I can configure my app’s address. How can I do that in an Next.js/Prisma application? I’m specifically talking about the 0.0.0.0, since my Dockerfile already expose 3000 and my fly.toml already has internal_port = 3000.

The onus is on your app to bind to the host/port, not fly. Nextjs’ default host:port is 0.0.0.0:3000, so you may be doing something that’s overriding the default.

Then what am I likely doing that’s overriding the default if that’s the case? And is there somewhere in some settings where I can modify this?
Meaning I can modify the 3000 part in my Dockerfile et fly.toml, but there’s nothing that shows I can do the same for 0.0.0.0.

I wrote ENV HOSTNAME “0.0.0.0” in the Dockerfile to force the hostname and it solved the issue.

how are you starting the next server? If you built the standalone, it should have set the host to 0.0.0.0

In either case, you should bind to [::] so you talk to other instances via flycast

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.