Multiple machines in one app, or multiple apps?

I need my app to have a separate process to run a simple worker script. However, based on Multiple processes inside a Fly.io app · Fly Docs, it seems sensible to not do so.

So how do i manage having another machine or app for my worker? Currently, I have a postgres-db app, my main app, and prod/staging versions of both. I deploy this with a single fly.toml from one repo.

Now that I want another app or machine, how do i manage that with my repo? Ideally, I’d want to use a single repo.

I have this currently working well;

fly machine run . npm run start:worker -c worker.toml --app my-app-staging --name worker-staging

now this does not get updated when i deploy. So how do I now update this efficiently? Ideally I’d want to manage the worker code in the same repo, and have it use the same dockerfile.

Appreciate any advise/discussion :slight_smile:

Two machines, one app, one image, deployed together? Sounds like App configuration (fly.toml) · Fly Docs is what you are looking for.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.