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 0.0.0.0
, 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 - 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" , "0.0.0.0:8000", "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
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 0.0.0.0
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!