Public web service + private workers setup

Ok, I got it working!

  1. EXPOSE 3001/tcp in the Dockerfile
  2. 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
  1. 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.