tldr; how to configure a single fly.io app to run multiple processes on separate vms and control which of these processes is publicly accessible and which are not.
I am struggling to set this up personally. At the moment fly.io is creating all my processes on different machines (which is what I want it to do), but the [[services]] config that I have at the moment seems to not be working (in the sense that my webhooks service does not seem to be publicly accessible over http or https).
fwiw, here is my config atm:
primary_region = "ord"
[env]
SERVER_PORT = "3000"
WEBHOOK_SERVICE_PORT = "3030"
[processes]
api = "bun run start:main"
webhooks = "bun run start:webhooks"
cron = "bun run start:cron"
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
processes = ["api"]
[http_service.concurrency]
type = "requests"
hard_limit = 250
soft_limit = 200
# config for the webhooks service
[[services]]
processes = ["webhooks"]
internal_port = 3030
protocol = "tcp"
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
[[services.ports]]
handlers = ["http"]
port = 8080
force_https = true
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services]]
processes = ["webhooks"]
internal_port = 3030
protocol = "tcp"
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
[[services.ports]]
handlers = ["http"]
port = 8080
force_https = true
[[services.ports]]
handlers = ["tls", "http"]
port = 443
# DO NOT EXPOSE THE CRON SERVICE
# hence no port info provided
[[services]]
processes = ["cron"]
internal_port = 9090
protocol = "tcp"
min_machines_running = 1```
The other thing I’d check would be that the webhook service is indeed running on port 3030 and so available to connect to. That should be shown in flyctl logs.
I ended up realizing that I had to change the tls setting for the webhook (along with removing the duplicate code as you pointed out). Here is the working config: