[erlang-questions] Deploying multiple webapps
Wed Dec 16 00:41:47 CET 2015
I've got a collection of small services, with minimal coupling
between the back ends of those services (orchestration is done mostly
client-side). I'd like to put an HTTPS interface in front of each one
-- say, with cowboy.
What I'd also like to be able to do, at least in principle, is
deploy some arbitrary subset of those services on each machine in my
(comedically-named) server farm. I'd like to be able to do this with
one TLS configuration, and preferably under a single port.
i.e., access my services through
Now, in python-land, which is largely where I come from, I'd set up
Apache with mod-wsgi, and deploy each WSGI app to a specific URL
within the same URL namespace. I'm not quite sure how to do that
easily with erlang+cowboy, because there seems to be no easy way of
treating a webapp as a unit within a larger server configuration. I
keep coming to one of two approaches:
1) Write each service completely independently (as HTTP), run it on a
distinct port, and splice together the URL namespaces through a
reverse proxy on a "normal" web server like Apache.
2) Find some way to automatically write a top-level router for cowboy,
for each set of services that I want to deploy to a machine.
I don't much like option 1, but I like option 2 even less. I guess
I could write some kind of "top-level" app that, given a bunch of
webapp modules (via a configuration file of some kind), gets a router
for each module and transforms those routers into a single router
config. Does such a thing already exist?
It all just feels a bit awkward, and I feel like I'm missing
something. What do other people do to put together this kind of setup?
Hugo Mills | I spent most of my money on drink, women and fast
hugo@REDACTED carfax.org.uk | cars. The rest I wasted.
PGP: E2AB1DE4 | James Hunt
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: Digital signature
More information about the erlang-questions