I have a few HTTPS REST and Websocket services I want to deploy on fly. I’m having trouble figuring out what the best way to use process groups, the fly.toml, and Dockerfiles is to create separate apps I can launch and deploy from one monolithic codebase. For context, it’s a big TypeScript repo with a few Express and Websocket Servers (though I’m planning on migrating to bun.js) defined at the top level of the src/ directory.
If I try to use process groups, I can get both processes running but only one of the internal ports can be exposed as a service in the fly.toml config.
As far as I know, there’s no good way to keep two apps in the same fly.toml or multiple fly.toml files in the same repo or root directory.
I could use a process manager and expose an HTTP service to route between my other services internally, but that seems like over-engineering.
Another option is to factor out common code into a library I install into separate repos or subdirectories that contain their own fly.toml files defining separate apps. This seems workable but I don’t like being forced to maintain separate repos for every microservice.
Any recommendations, or something I’m missing?