sergio
1 umbrella app, can I host different apps to different Heroku apps?
I’ve been trying for two days to get an Elixir umbrella app to work on Heroku with a proxy app on a single heroku application to no success. It seems like I’m hammering my head against a wall haha.
I was wondering if I have this umbrella app:
- App
- App (elixir)
- AppWeb (phoenix)
- AppMarketing (phoenix)
Can I deploy it to two different Heroku apps in such a way that AppWeb runs on one app, and AppMarketing runs on a different heroku app? While both can share the business rule library of App?
This umbrella application is in a single git repository by the way.
Appreciate any helps with this! As my last recourse I’ll just use a single monolith phoenix app with scoped routes, but I would hate to do that if I can avoid it.
Most Liked
orestis
Umbrella applications are code-design concepts - just an easy way to develop related applications together and share code etc.
What you want is to create two different releases:
Release A will run App + AppWeb
Release B will run App + AppMarketing
This will work if the App is a library application, i.e., just a bunch of functions without its own supervision tree. If however it starts its own tree, which for example is the case if it uses Ecto, you would be better placed to run it only once. You will need to add extra configuration to your apps to teach them how to find the other nodes, and deal with Heroku’s daily restarts, firewalls, internal networking and so on.
All that said, as you’ve found out, dealing with complicated releases and distributed Erlang/Elixir adds significant complexity in your Ops. Since you don’t need to change your code dramatically to do this split later on, it’s best to start by running everything on a single node.
nivanson
I’ve been serving multiple apps with a custom endpoint proxying to the other endpoints. The other endpoints had server: false in their configuration. However I recently started using websockets and that’s where this setup fell short. Now I use a nginx proxy in front of the application. So still one application on heroku serving multiple applications with multiple endpoints.
https://hexdocs.pm/phoenix/1.3.0-rc.1/phoenix_behind_proxy.html
cblavier
Hi @arjun289
I’m running an umbrella app with websockets on Heroku for over a year now, without any trouble
Here is my setup: https://gist.github.com/cblavier/0c2cf3f101d82c32503774f179a66a3f
wmnnd
Elixir and Erlang/OTP do allow for communication between applications on different nodes but if you’re only just getting started and you’re not experiencing any actual problems with the current setup, using just one Heroku app for your whole umbrella application is probably the best way to go 
What is your reasoning for wanting to use multiple Heroku instances instead?
domvas
Hi,
maybe it’s not what I should do but I won’t answer the question “How can I have 2 heroku apps with one umbrella” but talking about my experience about the first case: one umbrella with a proxy deployed on heroku.
I presume that you know this resource: https://github.com/wojtekmach/acme_bank
Which is a (working) example of an umbrella app deployed to heroku with a proxy.
I followed this example for my own project and it works fine.
But Is encountered 2 problems:
- it is for phoenix 1.2 and as you know, phoenix 1.3 is out
- the phoenix-based apps are complete phoenix app as you expect a
mix ph(oeni)x.newto build. But if you have ever done amix ph(oeni)x.new --umbrella, you’ve seen that structure is quite different (and more interesting): it is like this
project_umbrella
|_ project
|_ project_web
Adding parts to this structure is intuitive, and in fact, the project app will hold the proxy code
Working example is better than words, especially considering my poor english.
Feel free to look at: https://github.com/dominique-vassard/vinculi
where I’ve implement these structure (with phoenix 1.3) which is deployed to heroku via travis.
Hope it helps and don’t hesitate if you have any question.
I’m kind of elixir newbie but be pleased to help 







