Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a generic command to the proxy support #311

Open
sekmo opened this issue May 19, 2022 · 2 comments
Open

Add a generic command to the proxy support #311

sekmo opened this issue May 19, 2022 · 2 comments

Comments

@sekmo
Copy link

sekmo commented May 19, 2022

I was having a look at the proxy feature of puma-dev and I thought that it would be very useful to have the possibility to write a generic command to be executed together with the port number, so that it would be very easy to work with different setups, like dockerized apps.

Imagine that we have a file where we can specify a port number and a command, like 8082:docker-compose up web -e PORT=8082: puma-dev will know that it will have to launch this command to start the application, then it will proxy the port number as it would do with the existent proxy feature.

Is it hard to do this? What would be the first steps if you would have to build this feature?
I was thinking about creating a fork and poke around :)

@nonrational
Copy link
Member

I'd start by looking at LaunchApp; it's responsible for booting the subprocess to run puma and returning the App to be added to the pool. We currently rely on unix sockets to talk to the underlying process, so I think there'd be some plumbing work to ensure that puma-dev's http server can correctly detect a healthy service and know when (in addition to how) to start and stop it.

@rbq
Copy link

rbq commented Jun 7, 2024

see also: #241

Since the idea was considered out of scope for puma-dev, my idea was to make it as easy as possible to build minimal Ruby-based proxy apps that manage the lifecycle of non-Ruby apps and containers. Does that make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants