I have a somewhat complex app that is running both a Rails server and a Node.js server with nginx proxying requests to them depending on the route (I’m attempting to slowly migrate a Rails app to Node.js). I’m brand new to Fly.io and I was trying to figure out if I could deploy to multiple machines using a different Dockerfile for each. The Multi-container Machines page seems to describe what I’m trying to do, but I can’t figure out how to use Dockerfiles stored in the repository instead of image names/URLs.
Is this possible? Or is there a better way to accomplish what I’m trying to do? I also found this article, but I’d prefer to use a separate Dockerfile for the Rails/Node.js servers if possible.
Use something like flyctl machine create (or the Machines API) to spin up separate machines using those images. Each machine can run a different service (Rails or Node), and you can configure them independently.
If you need routing between them, you can run a third machine with NGINX that proxies requests to the others based on the path.
This in theory should get you to your resolution, but I’m curious to know if you run into any pitfalls/issues. However, the Multi-container machines guide should get you to the resolution you are looking for as well. My suggestion was more of an alternative, to the guide. I wasn’t entirely sure what resolution “direction” you were looking for.
Ok, if I can’t have multiple images built as part of deploying, then I might go the single image route to keep deployment as simple as possible. Thanks for the help!