Closed kdevan closed 1 year ago
My understanding is that if you don't specify any services
it's still exposed on the private network (any port) - this is just for exposing public ports. Is that not working?
https://fly.io/docs/reference/configuration/#the-services-sections
You can have:
- No services section: The application has no mappings to the external internet - typically apps like databases that talk over 6PN private networking to other apps.
[...]
(Yes these docs are about fly.toml
, but that [services]
section is the equivalent of here. Note also that the private networking docs make no mention of this stuff, while the public networking docs do, and while titled 'public networking', the URL is even .../services
.)
Ah I did have to fiddle with a bit myself in the end - you do need the services, just don't attach a fly_ip
to the app and it will only be available on the private network.
The ports
key is still required, because that's still your mapping from port number outside vs inside the VM. Just like if you ran it with e.g. docker locally to test, you'd have -p 1234:80
say (or 80:80
) or equivalent in compose.
The internal_port
is the the port that's bound to in whatever you're running, EXPOSE
d in the dockerfile, and the ports
are those that should map into it on the machine itself - i.e. completely arbitrary, just has to match whatever you put in reverse_proxy
in Caddy.
Ok interesting. Thanks for the information. I believe I'll have a chance to try this out this weekend, I'll give an update here when I do.
Working great. That clarifies a lot for me, even just with machines in general. Was mostly using v1 apps before this. Thanks!
Most of my apps do not expose any public ports and are accessed through caddy as a proxy. It looks like I can't create a machine that doesn't expose any public ports though.
The
ports
key and then theport
key are both required. Is there a way to bypass this by any chance? I do need theinternal_port
and have that set along withprotocol
.I'm hoping to be able to do something like this: