Hi there,
I would like to deploy a background worker without any http_service. There should be exactly one instance of the worker, and it should not be publicly accessible.
My question is: what should the fly.toml look like?
I have a Dockerfile ready to deploy. The program just loops, and jobs are fired off interally based on a cron expression. All it does is make external API calls and save some data to a database.
This is my current fly.toml
app = "my-background-worker"
primary_region = "jnb"
And I am deploying from a monorepo with the following command
flyctl deploy --config ./my-background-worker/fly.toml --dockerfile ./my-background-worker/fly.toml
So far, it seems to be working. After deploying, fly creates a single machine with the Dockerfile running and it seems to be staying alive. How can I ensure that there is exactly one of these running at all times? It should never be scaled down to 0, and never scaled up beyond 1.
Thanks!
Emilio