Ok, I got it working!
EXPOSE 3001/tcp
in theDockerfile
- Map another port (8080) to the internal process port
# Private Worker
[[services]]
processes = ["worker"]
internal_port = 3001
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 0
[[services.ports]]
handlers = ["http"]
port = 8080
- Use
http://{app-name}.flycast:8080
to reach workers from within your Fly.io network.
I believe this should all be better documented. I know there’s a lot of documentation, but I don’t know, I feel it’s all spread all over the place. We need more working examples. This public web server + private worker is a very common practice, should be a template easy to find.