Is it OK to run non HTTP apps in Fly?

I need to deploy a small Node service for responding to Pub Sub events which won’t even listen to HTTP.

Would this work fine with Fly? Do you need HTTP to work for health checks and so on?

You can, it’s a little hacky though. They do require a network service of some kind .:slight_smile:

We run Buildkite agents like this, they export Prometheus metrics over port 8080.

We’re planning on adding worker support any day now so you can avoid the hackiness. :tm:

2 Likes

“hackiness” it’s a technical term, right? :rofl:

Great, I will just use it locally until it can be deployed to Fly as a worker!

Looking forward to workers :partying_face:

@kurt Any luck on the workers? I just joined fly and my app has two parts two it. One that serves HTTP requests (and needs to scale), and the other is a Job handler which should remain at 1. Is this currently possible?

I’m pretty sure you can just configure the app without any services configured and it can act as a worker.

This doesn’t auto scale, but running it at a scale of 1 would give you the worker you need.

Thanks for the response, this results in two different apps right? Is it possible to have them under one app so that running the deploy command would publish them both?

Not at the moment. It’s been mentioned before that they want to better handle the worker + web app, but that’s not something they’ve solved for yet.

You’ll need a separate app for the web service and an app for the worker. They can be scaled independently.

1 Like

Not a way to deploy two apps from one command, but you could write a wrapper script around the deploy command.

See the docs on the deploy command.

Basically you can use the —config and —app flags to deploy two separate toml files and apps, respectively.

It’s not ideal, but it should work okay.

1 Like

Yeah I’ll do this for now but I hope this is on the roadmap, the original response was from 6 months ago. Thanks for the help!

Anytime!

1 Like

It has been a while! Once we get postgres buttoned up I think this will become more important since it’s common in fullstack apps.

2 Likes

Just chiming in that this is something we’d be interested as well! Going to work on setting it up as a standalone app w/o a services fly.toml section for the time being.

1 Like

This is now a lot more common. We do that for our own apps.

Simply omitting the whole [[services]] section of your fly.toml should do the trick!

1 Like