Bind to host `fly-local-6pn`

Hey Fly-community,
I’ve ran intro an issue where an app service (internal app I use as database) is not reachable from my api app. I’ve researched the docs and indeed, I was binding to IPv4 wildcard, which is discouraged in the docs: Connect to an App Service · Fly Docs
I’ve then tried binding to fly-local-6pn but the database wouldn’t start up. Then I tried binding to the IPv6 wildcard [::] which works :tada: - however it is also discouraged according to the docs linked above and for an internal service I should bind to fly-local-6pn (see here).

These are the three Dockerfile CMDs I’ve tried and the result:
CMD ["start", "--bind" , "", "file://data/srdb.db"] => runs but not reachable
CMD ["start", "--bind" , "fly-local-6pn:8000", "file://data/srdb.db"] => fails to run: error: Invalid value "fly-local-6pn:8000" for '--bind <bind>': Provide a valid network bind parameter
CMD ["start", "--bind" , "[::]:8000", "file://data/srdb.db"] => runs and is reachable :tada:

GitHub Issue with surrealdb for reference: Bug: Can't bind to fly-local-6pn:8000 · Issue #2360 · surrealdb/surrealdb · GitHub

In addition to surrealdb, I’ve also experimented with the different host options for a vapor app built by a Dockerfile (Vapor: Deploy → Docker). The vapor app works correctly with but fails to start with [::] and is unreachable with fly-local-6pn.

Any suggestions how to properly bind to host fly-local-6pn are greatly appreciated!

Hi @abegehr

Where are you seeing [::] being discouraged? I don’t see that anywhere and I would recommend it as it’s easiest to use.

1 Like

Thanks for confirming, @charsleysa! I was under that impression from the note on ip wildcards (Connect to an App Service · Fly Docs) and thought they’re generally discouraged compared to fly-local-6pn but reading again it clearly states that using [::] for internal services is the way to go: “Services to be routed to using Fly Proxy need to bind to IPv4 addresses, and services to be reached over 6PN need to bind to IPv6” :+1:

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