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.
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: Cowboy 2.5 proxy, used to bind a single port (on Heroku) for umbrella Phoenix applications. It supports HTTPS and websockets properly. · GitHub
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









